Mysql – the safest way to install the sys schema on a production server

mysql-5.5sys

The reason I'm asking is because I need to install the sys schema on my database so that I can utilize performance_schema because I'm hoping that will help me figure out why mysql is crashing every 30 minutes exactly.

I am running MySQL 5.5.45 on Windows Server 2016. I have four schemas on this server, of which the production schema is 4.1GB in size. The other schemas are almost as big.

MySQL Workbench gives me an option to install it. Also, I understand that running mysql_upgrade will install it, which as far as I can tell simply executes mysqlcheck.

So it looks like I have three options for installing the sys schema.

  • Execute mysqlcheck (I think)
  • Execute mysql_upgrade
  • Click the install button on MySQL Workbench

What does MySQL Workbench do exactly? Does it simply execute mysql_upgrade or mysqlcheck? Or does it do the install a different way?

Will any or all of these options make my other schemas unusable while this install is executing (as in locking tables)? What other implications are there to using any of these three options? And most importantly, needing to install this on a production server, what is my best approach?

Best Answer

Option 4: Download it from github and install it manually.

Installation would work like this:

# mysql -uroot -ppassword < sys_56.sql

(I'm aware you're using MySQL 5.5. Please read on...)

When you examine what this does, you see that a separate schema is created and in this schema some procedures, functions, views and tables are created. Nothing too fancy. I can't imagine, that this would have any dramatic influence on the server.
Regarding compatibility with 5.5, I must admit that I'm not familiar with 5.5, but given that it's just some views and so on in a separate schema, I'd say that it either works or it doesn't. I personally wouldn't mind at all. Try it on a VM or docker container or whatever, if you like.