当前位置:网站首页>Change the password after installing MySQL in Linux

Change the password after installing MySQL in Linux

2022-04-23 16:48:00 A coir boat in the broken white clouds

1. modify my.cnf file

add to skip-grant-tables # Change Password
 Insert a picture here and add a description

2. Restart and change password

# restart mysql
 systemctl restart mysql_slave.service
# Get into mysql
mysql -S /data/mysql_storage/mysql.sock
# Change Password 
 update mysql.user set authentication_string=password('12349') where user='root';
# Refresh the permissions 
flush privileges;
# sign out 
exit

3. stay my.cnf File deletion skip-grant-tables, And restart mysql

The end! ~

版权声明
本文为[A coir boat in the broken white clouds]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231400068377.html