mysql常用命令

创建数据库指定编码
CREATE DATABASE `databasename` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

设置编码
SET character_set_client = utf8;
SET character_set_connection = utf8;
SET character_set_database = utf8;
SET character_set_results = utf8;
SET character_set_server = utf8;

SET collation_connection = utf8_bin;
SET collation_database = utf8_bin;
SET collation_server = utf8_bin;

修改权限
grant select,insert,update,delete on *.* to root@"%" Identified by "password";

use mysql;
select host,user,password from user;

flush privileges;

导入
mysql>use 数据库名;
mysql>set names 'utf8';
mysql>source data.sql;

你可能感兴趣的:(sql,mysql,SQL Server)