# for newer mysql or mariadb version
ALTER USER 'root'@'localhost' IDENTIFIED BY 'ZeKQxTW57VgDP0VN';
ALTER USER 'root'@'%' IDENTIFIED BY 'ZeKQxTW57VgDP0VN';
# for older mysql or mariadb version
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('ZeKQxTW57VgDP0VN');
SET PASSWORD FOR 'root'@'%' = PASSWORD('ZeKQxTW57VgDP0VN');
# local root login test
mysql -u root -pZeKQxTW57VgDP0VN
# make root can access from remote
grant all privileges on *.* to root@'%' identified by 'ZeKQxTW57VgDP0VN';
# remote test
mysql -h xx -u root -pZeKQxTW57VgDP0VN
new mysql modify password
最新推荐文章于 2024-04-04 22:22:30 发布