After upgrading MySQL to 5.7.8-rc and loging to server I got error:
Table 'performance_schema.session_variables' doesn't exist
I can't find any solution for this. Can you help ?
After upgrading MySQL to 5.7.8-rc and loging to server I got error:
Table 'performance_schema.session_variables' doesn't exist
I can't find any solution for this. Can you help ?
The mysql_upgrade worked for me as well:
Regards, MSz.
Follow these steps without
-p
:mysql_upgrade -u root
systemctl restart mysqld
I had the same problem and it works!
Since none of the answers above actually explain what happened, I decided to chime in and bring some more details to this issue.
Yes, the solution is to run the MySQL Upgrade command, as follows:
mysql_upgrade -u root -p --force
, but what happened?The root cause for this issue is the corruption of
performance_schema
, which can be caused by:This issue might have been present on your database even before the patch, but what happened on MySQL 5.7.8 specifically is that the flag
show_compatibility_56
changed it's default value from being turnedON
by default, toOFF
. This flag controls how the engine behaves on queries for setting and reading variables (session and global) on various MySQL Versions.Because MySQL 5.7+ started to read and store these variables on
performance_schema
instead of oninformation_schema
, this flag was introduced asON
for the first releases to reduce the blast radius of this change and to let users know about the change and get used to it.OK, but why does the connection fail? Because depending on the driver you are using (and it's configuration), it may end up running commands for every new connection initiated to the database (like
show variables
, for instance). Because one of these commands can try to access a corruptedperformance_schema
, the whole connection aborts before being fully initiated.So, in summary, you may (it's impossible to tell now) have had
performance_schema
either missing or corrupted before patching. The patch to 5.7.8 then forced the engine to read your variables out ofperformance_schema
(instead ofinformation_schema
, where it was reading it from because of the flag being turnedON
). Sinceperformance_schema
was corrupted, the connections are failing.Running MySQL upgrade is the best approach, despite the downtime. Turning the flag on is one option, but it comes with it's own set of implications as it was pointed out on this thread already.
Both should work, but weight the consequences and know your choices :)
I was able to log on to the mysql server after running the command @robregonm suggested:
A MySQL server restart is required.
As sixty4bit question, if your mysql root user looks to be misconfigured, try to install the configurator extension from mysql official source:
https://dev.mysql.com/downloads/repo/apt/
It will help you to set up a new root user password.
Make sure to update your repository (debian/ubuntu) :
sometimes
mysql_upgrade -u root -p --force
is not realy enough,please refer to this question : Table 'performance_schema.session_variables' doesn't exist
according to it:
cd [installation_path]\eds-binaries\dbserver\mysql5711x86x160420141510\bin
mysql_upgrade -u root -p --force