
In MySQL 5.7, anyone who has just installed their server and runs a SHOW PROCEDURE STATUS
command will be surprised by the number of procedures and functions that have been added. One of them is create_synonym_db
, which we will use to create schema (database) synonyms.
These procedures are located in MySQL’s new operational database: sys
. The procedure only exists in this schema, so either you must be connected to the sys
database, or create an alias for it. This is the first downside of this procedure — and a downside of the documentation as well, which does not make this clear at all.
So, let’s create our synonym info
for our old friend INFORMATION_SCHEMA
:

By doing this, our synonym is presented as a schema:


One annoying thing: the tables under a synonym schema are case-insensitive.

To “kill” a synonym schema, just run a DROP DATABASE
(on the synonym) without fear.
Visit our Blog
Learn more about databases
Learn about monitoring with advanced tools

Have questions about our services? Visit our FAQ
Want to see how we’ve helped other companies? Check out what our clients say in these testimonials!
Discover the History of HTI Tecnologia