mysql -uroot -p123456
mysql -uroot -p123456 -h127.0.0.1 -P3306
mysql -uroot -p123456 -S/tmp/mysql.sock
mysql -uroot -p123456 -e “show databases”
select user()\G; \G 为按列显示
mysql结构 : 库 --> 表 --> 行 --> 字段Aborted
> use mysql; # 切换库
> show tables; # 查看mysql库中的所有表
> show create database dbname;
> show create table tbname;
> show processlist;
> show full processlist;
> show variables;
> show variables like 'max_connect%';
> set global max_connect_errors=1000;
> grant dbcommand on dbname.tbname to 'user'@'host' identified by 'password';
> flush privileges; #授权后刷新权限
> show grants;
> show grants for user@192.168.127.1;