如何重置mysql的密码
2013-06-02 09:34
399 查看
原文链接:http://www.javaarch.net/jiagoushi/702.htm
如何重置mysql的密码 如果知道密码,则通过以下方式修改; gaurav@gaurav:~$ mysql --user=root --pass mysql Enter password: mysql> update user set Password=PASSWORD('new-password-here') WHERE User='root'; Query OK, 2 rows affected (0.04 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.02 sec) mysql> exit Bye 如果忘记密码,则先停止mysql,然后加上参数skip-grant-tables重新启动mysql server root@gaurav:~# /etc/init.d/mysql stop Now you should start up the database in the background, via the mysqld_safe command: root@gaurav:~# /usr/bin/mysqld_safe --skip-grant-tables & [1] 4271 Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[6763]: started 然后登陆mysql,修改密码 root@gaurav:~$ mysql --user=root mysql Enter password: mysql> update user set Password=PASSWORD('new-password-here') WHERE User='root'; Query OK, 2 rows affected (0.04 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.02 sec) mysql> exit Bye 最后重启mysql server就可以了。 root@gaurav:~# /etc/init.d/mysql start Starting MySQL database server: mysqld. Checking for corrupt, not cleanly closed and upgrade needing tables.. 用新密码登陆验证下 root@gaurav:~# mysql --user=root --pass=new-password-here Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 5.0.24a-Debian_4-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> exit Bye
相关文章推荐
- 阿里云服务器忘记MySQL的密码后该如何重置密码
- mysql忘记密码,如何重置密码
- mysql忘记密码 如何重置获取
- mysql忘记root密码如何重置
- mysql忘记密码后如何重置??
- xampp软件包如何重置mysql的 密码
- 在ubuntu中如何重置mysql服务器的root密码
- 如何重置MySQL超级账户的密码
- 如何重置 MySQL 或 MariaDB 的 Root 密码
- MySQL忘记root密码,如何重置
- Mysql忘记root密码后如何重置
- mysql忘记密码,如何重置密码
- 详解如何在Redhat Linux(CentOS)下重置MySQL根(Root)密码
- 如何重置本地开发环境的MYSQL密码
- windows环境下mysql忘记密码如何重置
- mysql忘记密码,如何重置密码
- 详解如何在Linux中重置MySQL或者MariaDB的root密码
- 如何重置mysql的密码
- 如何在 Linux 中重置 MySQL 或者 MariaDB 的 root 密码
- windows主机mysql忘记密码如何重置