用户相关
-
登录用户:
mysql -u root -p;
-
创建用户
//grant命令是创建MySQL的用户名和口令,均为www,并赋予操作test数据库的所有权限 grant all privileges on test.* to 'www'@'%' identified by 'www';
编码相关
-
查看当前数据库编码:
show variables like 'character%';
-
修改编码:
mysql> set character_set_client=utf8 ; mysql> set character_set_connection=utf8 ; mysql> set character_set_database=utf8 ; mysql> set character_set_database=utf8 ; mysql> set character_set_results=utf8 ; mysql> set character_set_server=utf8 ; mysql> set character_set_system=utf8 ;