mysql5.7 修改密碼,修改權限


1.修改數據庫對指定用戶和ip權限

  a. IP為192.168.0.1的用戶jack擁有對數據庫datebase的表table的 增刪改查權限, ,連接密碼為password

 grant select,insert,update,delete,create,drop on database.table to jack@192.168.0.1 identified by 'password';

 

  b. 192.168.0.1的用戶jack擁有對數據庫datebase所有表的所有操作權限,連接密碼為password

grant all privileges on datebase.* to jack@192.168.0.1 identified by 'password';

 

  c. 192.168.0.1的用戶jack擁有對所有數據庫所有表的所有操作權限,連接密碼為password 

grant all privileges on *.* to jack@192.168.0.1 identified by 'password';

 

2.linux登錄指定數據庫

mysql -P'port' -h'IP' -u'username' -p'password';

 

3.修改數據庫訪問密碼(mysql5.7以后mysql.user表中沒有了password字段,而是使用authentication_string來代替)

update mysql.user set authentication_string=password("new password") where User="username" and Host="localhost"; 
flush privileges;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM