MySQL 命令学习记录
工作中用到的一些 MySQL 命令,记录下方便日后查询
用户登录命令
本地登录
sql
mysql -u root -p |
远程登陆
sql
Mysql -P 端口号 -h mysql主机名\ip -u(用户) -p(密码) |
创建用户命令
创建本地用户命令
sql
grant all privileges on *.* to admin@localhost identified by 'password' with grant option |
创建远程用户
sql
grant all privileges on *.* to admin@"%" identified by 'password' with grant option |
查询命令
查看当前编码
sql
show variables like 'character%'; |
查看当前数据库类型
sql
show variables like 'character%'; |
查看死锁状态
sql
show status like 'table%'; |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Soyl's Blog!