当前位置: 移动技术网 > IT编程>数据库>Mysql > 安装MySQL8.0 遇到的3个小错误

安装MySQL8.0 遇到的3个小错误

2018年09月21日  | 移动技术网IT编程  | 我要评论

过去公司都是用的5.7 系列的mysql,随着8.0的发版,也想试着升级一下。遇到了两个小错误,记录在此。

路径设置:

安装包路径:/data/mysql80/

数据路径:

/data/mysql/

 

下面描述一下,我安装时遇到的错误 和 问题解决方案:

问题1   premission denied

因为 mysql80 安装文件 是我从其它server上copy过来的,不是官网下载解压,所以,我在初始化mysql  和 启动mysql 服务是报错,提示权限不够。

初始化报错:

启动服务报错 :

解决方案:

针对第一个错误,执行以下代码:

chmod -r 755 /data/mysql80/bin/

针对第二个错误,执行以下代码:

chmod -r 755 ./mysql.server   (这个文件是 /data/mysql80/support-files)

和  

chmod -r 755 /etc/init.d/mysqld

问题2  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 'password('xxxxx')' at line 1

在登录mysql,修改root密码时,使用就方法 set password=password(‘[新密码]’) 报错。

查看网上的相关解释为:

以前版本的mysql的密码认证插件是“mysql_native_password”,而现在使用的是“caching_sha2_password”。

解决方案:

alter user 'root'@'localhost' identified with mysql_native_password by '新密码';

flush privileges;

问题3 开启远程登入报错,you are not allowed to create a user with grant

当开启远程登入时,提示错误信息如下:

解决方案:

通过命令

select host,user,authentication_string,plugin from user;

查看host 栏位值 确实限定为  localhost ;

则直接通过 命令 

update user set host = "%" where user='root';

直接修改。

验证,可以远程连接了。

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网