linux mysql 忘记root密码
来源:互联网 发布:淘宝400 bad request 编辑:程序博客网 时间:2024/05/15 23:50
环境:
操作系统:Centos 5.5
数据库:MySQL 5.0.77
过程:
1、关闭mysql。
[root@localhost ~]#service mysqld stop
Stopping MySQL:
2、跳过授权表启动mysql,关闭网络监听,让其后台运行或者开个新终端。
[root@localhost ~]#mysqld_safe --skip-grant-tables --skip-networking
Starting mysqld daemon with databases from /var/lib/mysql
提示:此时按下CTRL-Z
[1]+
[root@localhost ~]#bg
[1]+ mysqld_safe --skip-grant-tables --skip-networking &
3、链接mysql服务器。
[root@localhost ~]#mysql
Welcome to the MySQL monitor.
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.
4、使用mysql数据库。
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
5、设置root新密码。
mysql>update user set password=password('123') where user='root';
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3
6、退出mysql。
mysql>quit
bye
7、重起mysql。
[root@localhost ~]#service mysqld restart
STOPPING server from pid file /var/run/mysqld/mysqld.pid
120928 11:38:28
Stopping MySQL:
Starting MySQL:
[1]+
现在你可以使用新的密码登录mysql了。
- linux mysql 忘记root密码
- linux mysql 忘记root密码
- Linux-mysql忘记root密码
- linux 忘记mysql root密码
- linux mysql root 忘记密码
- linux 下 mysql root 密码忘记解决办法
- linux中mysql的root密码忘记
- linux下mysql的root密码忘记
- Linux MySQL 忘记root密码的处理
- linux上mysql root密码忘记解决办法
- linux(centos)下mysql忘记root密码
- linux下忘记mysql root密码解决办法
- linux下mysql的root密码忘记
- linux下忘记mysql root密码解决办法
- Linux下MySQL忘记root密码 1.2
- Linux下忘记mysql的root密码
- Linux下MySQL忘记root密码怎么办
- Suse linux 下mysql忘记root密码
- 4.11、局部变量和全局变量
- Android xUtils框架(二) ViewUtils
- Android链接服务器问题解答001
- UVa #10285 Longest Run on a Snowboard (习题9-1)
- 程序员必读书单 1.0
- linux mysql 忘记root密码
- opencv学习:实现matlab中的stretchlim函数
- C# 中的委托和事件
- jquery ajax方式获取数据的测试桩
- 机器学习中的范数规则化之(二)核范数与规则项参数选择以及RPCA
- HTTP协议之multipart/form-data请求分析
- C# vs2010代码段(Code Snippets)
- Selenium 1.0 - Metrics Testing - xPath正确但是click方法没有反应
- Head First JQuery学习笔记(三)