MySQL Database Delete and change
Add :CREATE Database DBname charset GBK;
Delete: Drop database dbname;
: alter database dbname charset GBK ; renamed: The following
check : show databases; (show databases like '%name ';)
Check: View database definition: Show create library name;
(renamed) Baidu is about these three ways:
1. RENAME DATABASE db_name to New_db_name
This one.. This syntax was added in MySQL 5.1.7, and 5.1.23 was removed.
It is said that data may be lost. It's better not to use it.
2. If all tables are MyISAM type, you can change the name of the folder
Close Mysqld
Rename the Db_name directory in the data directory to New_db_name
Open mysqld
3. Rename all Tables
CREATE DATABASE New_db_name;
RENAME TABLE Db_name.table1 to New_db_name.table1,
Db_name.table2 to New_db_name.table2;
DROP DATABASE db_name;
This article is from the "Linux Warden" blog, so be sure to keep this source http://sswqzx.blog.51cto.com/2494644/1962997
MySQL Database Delete and change