ERROR 1682 (HY000): Native table 'performance_schema'.'session_variables' has the wrong structure


出现的原因是我升级了mysql的版本.


只要root用户执行以下语句即可.


# mysql_upgrade -u root -p --force
# systemctl restart mysqld 或 service mysql restart


附上my.cnf配置文件

[client]
port		= 3306
socket		= /var/run/mysqld/mysqld.sock

[mysql]
default-character-set = utf8

[mysqld_safe]
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
character-set-server = utf8
explicit_defaults_for_timestamp

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address	= 127.0.0.1

log-error	= /var/log/mysql/error.log

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/


你可能感兴趣的:(mysql)