linux mysql修改

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/MasterLipeng/article/details/78847827

方法一:

按 Ctrl+C 复制代码
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
按 Ctrl+C 复制代码

猜你喜欢

转载自blog.csdn.net/MasterLipeng/article/details/78847827