ubuntu修改Mysql密码的方法:在终端中结束mysql进程。# sudo /etc/init.d/mysql stop用mysql安全模式运行并跳过权限验证。# sudo /usr/b
在终端中结束mysql进程。
# sudo /etc/init.d/mysql stop
用mysql安全模式运行并跳过权限验证。
# sudo /usr/bin/mysqld_safe --skip-grant-tables
重新打开一个终端页面以root身份登录mysql。
# mysql -u root
输入修改root用户口令,例如:
mysql> use mysql;Reading table infORMation for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set PassWord = PASSWORD('root') where User ='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> exit
(注:括号里的'root'就是新密码。)
结束mysql安全模式,用正常模式运行mysql即可。
# sudo /etc/init.d/mysql restart
--结束END--
本文标题: ubuntu怎么修改mysql密码
本文链接: https://www.lsjlt.com/news/112776.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0