mysql相关命令行
文章目录
mysql相关命令行
mysql
服务器上查看mysql的版本
#4 $ mysql –help | grep Distrib
进入mysql命令行
格式: mysql -h主机地址 -u用户名 -p用户密码
mysql -hlocalhost -uroot -proot
insert into mysql.user(Host,User,Password) values(“localhost”,”testQ”,password(“fugu1234”));
|//显示的为当前使用的user及host;
//此处必须是mysql的root账号登陆
use mysql;
select distinct(User) from user;
//显示该数据库授权登陆的用户名(其实还有HOST的限制)
| select USER(); |
|---|
//查看MySQL用户权限:
show grants for 你的用户
//比如:
show grants for root@’localhost’;
—查看当前所有连接
show full processlist
— 查看当前最大连接数
show variables like ‘%max_connections%’;

