您好,登錄后才能下訂單哦!
這期內(nèi)容當(dāng)中小編將會給大家?guī)碛嘘P(guān)MySQL 5.7中怎么創(chuàng)建用戶并授權(quán),文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
--創(chuàng)建用戶
mysql> create user 'test'@'%' identified by 'System#2013';
Query OK, 0 rows affected (0.00 sec)
mysql> select host,user from mysql.user;
+-----------+-----------+
| host | user |
+-----------+-----------+
| % | test |
| localhost | jeffrey |
| localhost | mysql.sys |
| localhost | root |
+-----------+-----------+
4 rows in set (0.00 sec)
--授予對TEST數(shù)據(jù)庫的操作權(quán)限
mysql> GRANT ALL ON test.* TO 'test'@'%';
Query OK, 0 rows affected (0.01 sec)
--測試新創(chuàng)建的用戶
[root@T400-kelong ~]# mysql -utest -pSystem#2013
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.10-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use test
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> CREATE TABLE client_firms (
-> id INT,
-> name VARCHAR(35)
-> )
-> PARTITION BY LIST (id) (
-> PARTITION r0 VALUES IN (1, 5, 9, 13, 17, 21),
-> PARTITION r1 VALUES IN (2, 6, 10, 14, 18, 22),
-> PARTITION r2 VALUES IN (3, 7, 11, 15, 19, 23),
-> PARTITION r3 VALUES IN (4, 8, 12, 16, 20, 24)
-> );
Query OK, 0 rows affected (0.15 sec)
上述就是小編為大家分享的MySQL 5.7中怎么創(chuàng)建用戶并授權(quán)了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。