(ubuntu )mysql 修改用户密码

来源:互联网 发布:圆点矩阵 编辑:程序博客网 时间:2024/04/29 22:54
如果您已经忘记密码:# /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 namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> update user set Password = PASSWORD('root') where User ='root';Query OK, 3 rows affected (0.00 sec)Rows matched: 3 Changed: 3 Warnings: 0mysql> exit
原创粉丝点击