mysql資料庫新增使用者與使用者許可權

2021-06-20 09:54:00 字數 614 閱讀 3076

mysql資料庫新增使用者及分配許可權的方法。

1,建立使用者並分配許可權; 

insert into mysql.user(host,user,password) values("localhost","phplamp",password("1234"));//建立使用者 

grant all privileges on dbname.* to 'username'@'%' identified by 'password';//建立使用者並分配所有許可權

grant select,update on phplampdb.* to phplamp@localhost identified by '1234';//建立使用者並分配許可權

update mysql.user set password=password('新密碼') where user="phplamp" and host="localhost";//修改使用者密碼

2,刪除使用者指定許可權 

revoke insert,update,delete,select on *.* from 'xbb'@'localhost' identified by '123';

mysql新增資料庫新增使用者並授權使用者

建立資料庫 create database basename 建立使用者 create user username 訪問限制 identified by password 授權使用者 grant all privileges on 資料庫名稱.表名稱 to username 訪問限制 重新整理使用者...

MySQL 命令 建立資料庫 新增使用者 使用者授權

2 mysql 8.0 初始化的配置檔案需要指定 建立 testdb 資料庫 建立 test 使用者 密碼 123456 允許外網訪問 localhost僅伺服器訪問 create user test identified by 123456 授予 test 使用者在外網通過密碼對 testdb 資...

Mysql 新增使用者和資料庫授權

注 我的執行環境是widnows xp professional mysql5.0 一,建立使用者 命令 create user username host identified by password 說明 username 你將建立的使用者名稱,host 指定該使用者在哪個主機上可以登陸,如果是...