(个人操作记录,怕以后用的时候又忘了)
修改root登录密码:
若忘记密码:
sudo cat /etc/mysql/debian.cnf
mysql -u debian-sys-maint -p
原始密码:P0QAQocVLM9fftak
用这个登录然后:
use mysql;
update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password";
flush privileges;
quit;
修改远程登录密码:
先登录mysql,然后输入:
grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
完事exit退出ok。