MySql建立使用者並授權

2021-08-03 02:05:47 字數 582 閱讀 2738

本文簡單描述如何在mysql下完成使用者的建立授權等操作

登陸mysql

使用root使用者登陸mysql

jacky@gentoo ~ $ mysql -uroot -p***xx  ///***xx代表各自的密碼

mysql> create user 'pysite'@'localhost' identified by '***xx';

自此完成資料庫使用者的建立

下一步對建立該使用者對應的資料庫

mysql> create database pysite;

query ok, 1 row affected (0.00 sec)

自此完成了資料庫的建立,下一步就是對pysite使用者授予建立好的資料庫的許可權

mysql> grant all privileges on pysite.* to pysite
此時完成資料庫使用者的授權操作,如果許可權沒有生效可以通過以下命令重新整理使用者許可權

mysql> flush privileges;

MySQL 建立使用者並授權

create user username host identified by password 說明 示例 create user jack localhost identified by 123456 create user rose 192.168.38.110 idendified by 1...

mysql建立使用者並授權

create database db create user user identified by pwd grant all privileges on db to user create user user admin identified by pwd grant select,insert,...

Mysql建立使用者並授權

mysql uroot p 登入mysql use mysql 建立使用者 create user test123 localhost identified by 12345 這裡的test123表示user,localhost表示host,12345表示authentication string ...