1.查看初始密码 grep 'temporary password' /var/log/mysqld.log
修改密码 alteruserroot@localhost identified by 'passwd';
exit;
重新进入
或
update user set authentication_string=password('123456') where user="root";
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
flush priviledges;
2.远程连接
GRANTALLPRIVILEGESON *.* TO'root'@'%' IDENTIFIED BY'password'WITHGRANTOPTION;
FLUSH PRIVILEGES;
service mysqld restart
本文介绍了如何查看和修改MySQL的初始密码,并提供了通过SQL命令更新密码的方法。此外,还详细说明了如何设置MySQL的root用户能够从远程进行连接。
1031

被折叠的 条评论
为什么被折叠?



