Linux MySQL 密码修改
来源:互联网 发布:淘宝客服一天接待人数 编辑:程序博客网 时间:2024/05/21 09:27
1)如果您没有忘记密码的情况下,可以通过UPDATE直接编辑user表来修改密码:
进入数据库mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;
或者
/etc/init.d/mysql stop
/etc/init.d/mysql start
2)如果您已经忘记密码:
# /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 names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set Password = PASSWORD('root') where User ='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> exit
# /etc/init.d/mysql restart 5、结束mysql安全模式,用正常模式运行mysql。
mysql> update mysql.user set password=PASSWORD('新密码') where User='root';
6、试试你新修改的口令
mysql> flush privileges;
mysql> quit
参考推荐:
Ubuntu 如何修改mysql的账号密码
MySQL命令操作
MySQL 常用语法总结
MySQL 数据库常用命令小结
MySQL字符集乱码总结
10款出色的NoSQL数据库
- linux mysql修改密码
- Linux MySQL 密码修改
- linux修改mysql密码
- linux mysql 修改密码
- Linux MySQL密码修改
- linux 修改mysql密码
- mysql linux 下修改密码
- linux下mysql修改密码
- Linux下mysql修改密码
- Linux mysql 修改用户名密码
- linux 修改mysql数据库密码
- linux下修改mysql密码
- linux下mysql密码修改
- linux修改原来mysql 密码
- linux环境修改mysql密码
- linux下修改mysql密码
- linux mysql忘记密码修改密码
- linux mysql 忘记密码 怎么修改密码
- MFC的运行顺序
- Android软键盘弹出不影响布局的方法
- linux 3.4.10 内核内存管理源代码分析4:伙伴系统内存释放
- HTML:1.文本修饰
- MFC程序运行机制
- Linux MySQL 密码修改
- 会这些你才够格!极客必备九大技能
- 下载源码网址收藏(网页制作源码下载网址、后台源码下载网址、域名注册网址)
- 程序员入门:如何自学编程
- android使用隐藏api的方法(使用被@hide的api)!!!!!!!
- 更新过程意外停止,造成提示:yum-complete-transaction的解决方法
- Wordpress最新3.5版本如何修改图片默认上传目录路径
- 将linux 命令的执行结果在屏幕输出的同时保存到文件
- 字典树