解决:mysql8 要求先建用户,后授权 然后打开mysql默认的3306端口 然后允许使用旧的密码验证方式:最后 sqlyog就可以远程登陆了。如果先安装了一个版本的,再安装新版本,需要先把旧版本的数据删除,否则启动不起来,重点是删除 /var/lib/mysql下的所有文件 select @@validate_password_policy set glob...
mysql 8 的远程连接问题
问题:最近开始用mysql8,结果发现在sql语法比之前的版本严格了许多。。此处先解决授权sql报错问题,报错如下
mysql> grant all on dev1_test1.* to dev1@'%' identified by '12345678';
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 '12345678'' at line 1
解决:mysql8 要求先建用户,后授权
然后打开mysql默认的3306端口
然后允许使用旧的密码验证方式:
最后 sqlyog就可以远程登陆了。
如果先安装了一个版本的,再安装新版本,需要先把旧版本的数据删除,否则启动不起来,重点是删除 /var/lib/mysql下的所有文件
select @@validate_password_policy set global validate_password_policy=0; update mysql.user set authentication_string=password('new password') where user='root' ;
允许root 远程登录: grant all privileges on . to 'root'@'%' identified by 'password' with grant option; select host,user from user where user='root' flush privileges;
2022-07-16