新建数据库,修改类型为utf8
create database abc;
use abc;
ALTER DATABASE abc DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
直接新建db为utf8
CREATE DATABASE dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
复制db
mysqldump dbfrom -uroot -ppwd –add-drop-table | mysql -h localhost dbto -uroot -ppwd
删除db
drop database dbname;
so,如果想修改数据库名字,就可以
先复制,再删除旧的,比网上那些renameto之类的要稳