(4)navicat备份mysql数据库报错:The ‘INFORMATION_SCHEMA.SESSION_VARIABLES’ feature is disabled; see the docu

navicat中备份mysql数据库报错:
错误描述:
The ‘INFORMATION_SCHEMA.SESSION_VARIABLES’ feature is disabled; 
see the documentation for ‘show_compatibility_56’

原因:
从mysql5.7.6开始 information_schema.global_status 
已经开始被舍弃(表不存在),为了兼容性,此时需要打开show_compatibility_56

解决:
方法1:
docker exec -it mysql-name /bin/bash

进入后:
mysql -u root -p

开始执行下列命令:

MySQL> set global show_compatibility_56=on;
MySQL> show variables like '%show_compatibility_56%';

重启mysql后重试;

方法2:
修改mysql配置文件my.ini/my.cnf
在 [mysqld]段添加一行
show_compatibility_56 = 1

注意:因为配置文件挂载到本地宿主机
通过查看-v 可以查看到挂载路径:
宿主机路径:容器路径
-v /kubernets/mysql-1/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf

命令:·
vim /kubernets/mysql-1/mysqld.cnf
在 [mysqld]段添加一行
show_compatibility_56 = 1

查看当前mysql容器id:
docker ps | grep mysql

重启mysql:
docker restart container_id

尝试备份.

你可能感兴趣的:(lwk-note-elec,mysql)