yum 安装的mysql 重置密码
2011-11-08 15:04
423 查看
不小心忘了mysql密码,系统是rhel5.5 mysql版本5.0.77,yum安装的,简单记录下恢复过程。 [root@localhost ~]# /etc/init.d/mysqld stop Stopping MySQL: [ OK ] [root@localhost ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & [root@localhost ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.77 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | demo | | mysql | | ndodb | | webdns | +--------------------+ 5 rows in set (0.03 sec) 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> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | func | | help_category | | help_keyword | | help_relation | | help_topic | | host | | proc | | procs_priv | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 17 rows in set (0.00 sec) mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root'; Query OK, 3 rows affected (0.00 sec) Rows matched: 3 Changed: 3 Warnings: 0 mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> QUIT Bye [root@localhost ~]# /etc/init.d/mysqld restart Starting MySQL: [ OK ] [root@localhost ~]# mysql -uroot -p123456 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 5.0.77 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
相关文章推荐
- centos7 使用yum安装mysql并开启远程连接及重置密码
- 在CentOS 6.3 64bit下yum安装MySQL后重置root密码的方法
- 安装好mysql后登录重置密码
- CentOS7.0上安装mysql重置root密码
- mac下安装mysql,密码重置
- 记录下 rhel 7 安装MySQL 并重置root密码
- centos6.5下yum安装mysql(包含密码修改的正确路径)
- 使用RPM包离线安装MariaDB 10.0.20 , mysql安全模式重置密码
- MAC下安装卸载MySQL及重置密码
- CentOS 6.5下安装MySQL后重置root密码方法
- 使用yum安装mysql,首次登录密码查看
- cento7安装的mysql重置密码
- Mac下通过Homebrew安装MySQL 和重置root登录密码
- Linux MySQL 安装、远程访问和密码重置
- yum安装MySQL并设置密码
- CentOS6下安装mysql后,重置root密码方法
- CentOS 7下安装MySQL后重置root密码方法
- yum安装MySQL并设置密码
- mysql 5.7 安装及修改/重置密码
- Wampserver默认mysql密码重置,Wampserver教程,Wampserver安装教程,网站发布外网