菜鸟笔记
提升您的技术认知

mysql数据库 基本操作-ag真人游戏

对mysql数据库的基本操作,启动,关闭,登录,退出,帮助等等……

脑图

启动mysql服务

net start mysql

c:\windows\system32>net start mysql
mysql 服务正在启动 .
mysql 服务已经启动成功。

关闭mysql服务

net stop mysql

c:\windows\system32>net stop mysql
mysql 服务正在停止.
mysql 服务已成功停止。

登录mysql服务

注意,地址就是ip,本地可以写localhost和127.0.0.1,端口就是mysql启动服务占用的端口号 默认是3306

mysql -h 地址 -p 端口 -u root -p 密码

c:\windows\system32>mysql -h localhost -p 3306 -u root -p
enter password: ****
welcome to the mysql monitor.  commands end with ; or \g.
your mysql connection id is 3
server version: 5.7.19 mysql community server (gpl)
ag真人试玩娱乐 copyright (c) 2000, 2017, oracle and/or its affiliates. all rights reserved.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.

退出mysql登录

ctrl z 回车
exit
quit

显示哪些线程正在运行

show processlist;

mysql> show processlist;
 ---- ------ ----------- ------ --------- ------ ---------- ------------------ 
| id | user | host      | db   | command | time | state    | info             |
 ---- ------ ----------- ------ --------- ------ ---------- ------------------ 
|  4 | root | localhost | null | query   |    0 | starting | show processlist |
 ---- ------ ----------- ------ --------- ------ ---------- ------------------ 
1 row in set (0.03 sec)

查看帮助

help 关键字;

网站地图