ubuntu下修改mysql数据库root密码
疏忽大意,长久荒废,忘记了MySQL的root密码 解决方法如下: 1、终端中结束当前正在运行的mysql进程。 # sudo /etc/init.d/mysql stop 2、用mysql安全模式运行并跳过权限验证。 # sudo /usr/bin/mysqld_safe --skip-grant-tables 3、ctrl+T重开一个终端以root身份登录mysql。 # mysql -u root 4、修改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 Pas