修改msql密码

/etc/my.cnf中加入

skip-grant-tables

重启mysql

systemctl restart mysqld

登陆mysql

mysql -uroot -p

use mysql;
update user set authentication_string=password('root') where user='root';

/etc/my.cnf中加入

#skip-grant-tables

重启mysql

systemctl restart mysqld

mysql -uroot -proot

登陆后修改密码

alter user 'root'@'localhost' identified by 'root';

建立远程用户
CREATE USER 'root'@'%'IDENTIFIED BY 'xxxxxxxx';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'xxxxxx WITH GRANT OPTION;
FLUSH PRIVILEGES;

登陆后修改密码

alter user 'root'@'%' identified by 'root';

发布了191 篇原创文章 · 获赞 43 · 访问量 26万+

猜你喜欢

转载自blog.csdn.net/leoufung/article/details/102989047