1、远程登录mysql
先授权:如:grant all on *.* to 'root'@'192.168.81.130' identified by '52033dd';
查看是否生效:select * from user where host='192.168.81.130'\G;
远程登录:mysql -uroot -h192.168.81.130 -p3306 -p52033dd
2、本地使用socket登录
如:mysql -uroot -S /tmp/my.sock -p
再输入密码。
3、本地使用用户密码登录
如:mysql -uroot -p52033dd