Change the MySQL database name and MySQL Database Name
First, I would like to thank the online comrade who has provided a solution.
Many beginners of MySQL Databases may encounter a problem about renaming. You may think of searching on the internet as soon as possible. In fact, I am in the same mentality as everyone else (haha ).
As far as I know, the statement for changing the TABLE name of the MySQL database is RENAME TABLE old_table_name to new_table_name, maybe you will say that the name of the database is almost the same (if you are using a very early version, you are right, but most of us are using a very new version now. version x)
Let's talk about the two methods.
1. In the default MyISAM storage engine: Disable mysql, change the name of the database folder to be modified in the data directory under the mysql directory to the name of the new folder, and then restart the mysql service, you can.
2. Under the default InnoDB Storage engine: Create a database according to the new name and delete the triggers for all tables in the original database, use rename table [run the rename table db_name.tbname to new_db_name.tbname command] to copy the data table in the original database to the new database, and then create the previously deleted trigger in the table in the new database, create a stored procedure or something.