"Rename" bitsCN.com of the MySQL database
Data exported from the MySQL database is stored in a file with the suffix ". SQL. In fact, this file is a text file, which contains many SQL statements. After all the SQL statements in the text file are executed on an empty database, the generated database is consistent with the data that was previously exported.
Mysqldump.exe can be used to export data in the database. some graphical MySQL management tools, such as MySQL Workbench, use it to export data. However, the exported SQL file still contains its original database. That is to say, if the table is in the database named test before export, then when the exported SQL file is imported to other services, A database named test will still be created (if it does not exist ).
Many times, we need to change the database name. for example, if you have a wordpress blog locally and want to upload it to the space provided by the space provider, but the space provider only provides you with a database with a given name-or you just want to change the database name. This problem has plagued me for one night ...... Later, I found that a simple solution could be used.
Open the SQL file in notepad, and there are three names of the original database at the top (including a comment, here is three "test "). You just need to change the three names to the new database name you want, and then import the new environment, a new database will be created.
This is a typical newbie problem. ignore it as a veteran.
BitsCN.com