\1146 - Table 'performance_schema.session_variables' doesn't exist

发布时间 2023-08-22 15:03:58作者: 不会游泳的鱼丶

Mysql无法正常连接:

 

错误原因:Navicat Premium :\1146 - Table 'performance_schema.session_variables' doesn't exist

解决办法

[root@zookeeper1 usr]# mysql_upgrade -u root -p --force
Enter password:

 

 

 

错误原因:未设置远程连接:

grant all privileges on *.* to 'root'@'%'identified by 'youpassword' with grant option;

注意:远程连接的密码 与上面设置的要一致 ,这个是做的远程的登录的用户 密码  

全部开放

GRANT ALL PRIVILEGES ON . TO ‘root’@‘%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;

指定ip开放

GRANT ALL PRIVILEGES ON . TO ‘root’@‘192.168.12.1’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;

4、刷新权限flush privileges;
5、重启MySQLnet stop mysql,net start mysql

 

 

 

更改密码 的时候注意 版本不一样  命令不一样 

 错误原因: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USER 'root'@'localhost' IDENTIFIED BY 'mypass'' at line 1

MySQL 5.7.6 and later:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'

MySQL 5.7.5 and earlier:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

 

 

大小写区分 (目前我没遇到)

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual thatcorresponds to your MySQL server version for the right syntax to use near '('123456') where user='root'' at line 1

终于找到了这个方法,成功解决!

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

注意:部分需要大写!!!

 

 

端口未成功添加,可以telnet 进行测试 端口是否正常开发

sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport [端口号] -j ACCEPT