修改mysql数据库密码出现的问题
来源:10-19 CentOS MySQL环境安装

全栈控
2018-12-13
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
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 'IDENTIFIED BY 'MyNewPass4!'' at line 1
出现了如上的报错,修改不了密码,请问原因是什么?
还有,我的服务器的系统是centos7,在安装mysql时好像与centos6的不同,老师能否给一下centos7下的权威的安装方法?
注:当前安装的是mysql-community-server-5.6.42-2.el7.x86_64 版本,不知是否合适?
服务器版本:centos_7_04_64_20G
写回答
1回答
-
你好,这个问题与CentOS版本无关,主要是mysql版本的问题,课程中使用的是mysql 8.0,而你安装的是mysql 5.6,可以尝试通过下面的指令来修改密码:
set password for root@localhost = password('123');
012018-12-15
相似问题