如果您已经忘记密码: # /etc/init.d/mysql stop 1、结束当前正在运行的mysql进程。 # /usr/bin/mysqld_safe --skip-grant-tables 2、用mysql安全模式运行并跳过权限验证。 # mysql -u root 3、重开一个终端以root身份登录mysql。 mysql> use mysql; 4、修改root用户口令。 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
(ubuntu )mysql 修改用户密码
最新推荐文章于 2025-05-12 16:27:12 发布