标签:创建用户 相关信息 host get UI utf8 database xsocket can
1.通过mysql数据库的user表查看用户相关信息
mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select host,user,password from user ; +-----------+------+-------------------------------------------+ | host | user | password | +-----------+------+-------------------------------------------+ | localhost | root | *87F2746835A04895BB77E12AA5054A767******* | | qxyw | root | | | 127.0.0.1 | root | | | localhost | | | | qxyw | | | +-----------+------+-------------------------------------------+ 5 rows in set (0.00 sec)
2.创建数据库
mysql> create database [databasename] default character set utf8 collate utf8_general_ci; Query OK, 1 row affected (0.00 sec)
3.创建用户
mysql> create user ‘dba‘@‘%‘ identified by ‘*******‘;
Query OK, 0 rows affected (0.00 sec)
4.对dba用户给予针对指定数据库进行增删改查的权限
mysql> grant select,insert,update,delete,create on [databasename].* to dba; Query OK, 0 rows affected (0.00 sec)
注意:修改完权限以后 一定要刷新服务,或者重启服务,刷新服务用:FLUSH PRIVILEGES
标签:创建用户 相关信息 host get UI utf8 database xsocket can
原文地址:http://www.cnblogs.com/chenjianxiang/p/7053830.html