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