linux怎么删除mysql用户和组_linux下在mysql数据库中创建和删除用户
第一步:進(jìn)入mysql mysql -uroot msyql -p 回車(chē)輸入root用戶(hù)的密碼(安裝mysql時(shí)自己指定的) 創(chuàng)建一個(gè)test用戶(hù),密碼位test,“%“代表聯(lián)網(wǎng)中的所有用戶(hù)都能用test用戶(hù)名訪問(wèn)數(shù)據(jù)庫(kù)(所有數(shù)據(jù)庫(kù)中的所有表); grant all on *.* to 'test'@'%' identified b
第一步:進(jìn)入mysql
mysql -uroot msyql -p 回車(chē)輸入root用戶(hù)的密碼(安裝mysql時(shí)自己指定的)
創(chuàng)建一個(gè)test用戶(hù),密碼位test,“%“代表聯(lián)網(wǎng)中的所有用戶(hù)都能用test用戶(hù)名訪問(wèn)數(shù)據(jù)庫(kù)(所有數(shù)據(jù)庫(kù)中的所有表);
grant all on *.* to 'test'@'%' identified by 'test';
并將/etc/mysql/mysql.cnf中的bind-address一行注釋
訪問(wèn)a_db中的所有表,用如下語(yǔ)句實(shí)現(xiàn)
grant all on a_db.* to 'test'@'%' identified by 'test';
限制權(quán)限,限制test用戶(hù)只能查詢(xún)a_db中的所有表
grant select on a_db.* to 'test'@'%' identified by 'test';
查看mysql中的所有數(shù)據(jù)庫(kù)用戶(hù)
select distinct concat('User: ''',user,'''@''',host,''';') as query from mysql.user;
刪除test用戶(hù)
delete from user where User='test' and Host='%';
flush privileges;
刪除數(shù)據(jù)庫(kù)和數(shù)據(jù)表
drop database 數(shù)據(jù)庫(kù)名;
drop table 數(shù)據(jù)表名;
本文原創(chuàng)發(fā)布php中文網(wǎng),轉(zhuǎn)載請(qǐng)注明出處,感謝您的尊重!
總結(jié)
以上是生活随笔為你收集整理的linux怎么删除mysql用户和组_linux下在mysql数据库中创建和删除用户的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 2017java最新面试题_2017年最
- 下一篇: 微信小程序服务器域名修改生效时间,微信小