3.成立顾客皇冠现金app

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)

user表中host列的值的含义

%               相称全部主机

localhost    localhost不会被拆解深入分析成IP地址,间接通过UNIXsocket连接

127.0.0.1   会通过TCP/IP合同连接,而且只可以在本机采访;

::1              ::1就是特别帮忙ipv6的,表示同ipv4的127.0.0.1

4.对dba客户给与针对钦命数据库实行增加和删除改查的权位

mysql> grant select,insert,update,delete,create on [databasename].* to dba;
Query OK, 0 rows affected (0.00 sec)

皇冠现金app,小心:改善完权限现在 必须求刷新服务,只怕重启服务,刷新服务用:FLUSH
PKugaIVILEGES

5.方可通过show
grants命令查看权限,若想要在原本的底蕴上平添权限则继续施行grant

mysql> grant drop on [databasename].* to dba;
Query OK, 0 rows affected (0.00 sec)
mysql> show grants for dba;
+----------------------------------------------------------------------------------------------------+
| Grants for dba@%                                                                                   |
+----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'dba'@'%' IDENTIFIED BY PASSWORD '*****************************************' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON `[databasename]`.* TO 'dba'@'%'              |
+----------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

 

6.透过revoke命令能够移除客商的有关权限

mysql> revoke drop on [databasename].* from dba;
Query OK, 0 rows affected (0.00 sec)
mysql> show grants for dba;
+----------------------------------------------------------------------------------------------------+
| Grants for dba@%                                                                                   |
+----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'dba'@'%' IDENTIFIED BY PASSWORD '*****************************************' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ON `[databasename]`.* TO 'dba'@'%'                    |
+----------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)