Linux Centos-6 Mysql修改密码 不需要输入原密码
来源:互联网 发布:windows一直在检查更新 编辑:程序博客网 时间:2024/06/06 11:04
Linux Centos-6 Mysql修改密码 不需要输入原密码
首先需要配置 my.cnf 文件 在其中 加入一行
【mysqld】下
skip-grant-tables
my.cnf 一般是在 etc目录下
然后就是修改密码
在 终端 输入 mysql -u root -p
[root@guhaotechnology ~]# mysql -u root -pEnter password:
会出现让你键入密码 由于我们修改过配置文件此处不用任何输入直接回车即可
接下来是 进入mysql 还需要选择下
use mysql;
mysql> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changed
最后修改密码并退出
mysql> update user set password("root") where user='root';ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '("root") where user='root'' at line 1mysql> update user set password=PASSWORD("root") where user='root';Query OK, 3 rows affected (0.07 sec)Rows matched: 3 Changed: 3 Warnings: 0mysql> exitBye
重启mysql使修改生效
[root@guhaotechnology ~]# service mysqld restartStopping mysqld: [ OK ]Starting mysqld: [ OK ]
这样基本问题就解决了
0 0
- Linux Centos-6 Mysql修改密码 不需要输入原密码
- CentOS 修改mysql的密码
- linux mysql修改密码
- Linux MySQL 密码修改
- linux修改mysql密码
- linux mysql 修改密码
- Linux MySQL密码修改
- linux 修改mysql密码
- Linux Centos 修改root密码
- Linux下,巧用my.cnf,mysql连接服务器不需要输入账号密码信息
- linux 传输不需要密码
- linux mysql忘记密码修改密码
- linux mysql 忘记密码 怎么修改密码
- linux下忘记密码修改mysql密码
- ubuntu sudo不需要输入密码
- ubuntu sudo不需要输入密码
- git push不需要输入密码
- git push 不需要输入密码
- 转:利用JAXB进行xml和javabean之间转换
- 二叉parsing树
- IOS开发-UIView之动画效果的实现方法(合集)
- iOS开发小技巧之--WeakSelf宏的进化,ios--weakself
- Unable to read entire header; 336 bytes read; expected 512 bytes
- Linux Centos-6 Mysql修改密码 不需要输入原密码
- LinearLayout布局中将一个控件放在屏幕的最下方-Android
- Poj 3259 Wormholes【SPFA判断负权回路】
- 【南理oj】113 - 字符串替换(STL - string)
- adb 无线连接手机
- BDL程序搬迁环境应注意的问题
- 我曾遇到的R文件报错的原因之一
- Linux迁移tomcat所在目录路径
- Fragment与Activity通讯