/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';