1. 程式人生 > 資料庫 >mysql5.7使用者建立及密碼修改

mysql5.7使用者建立及密碼修改

1.建立使用者並授權

  建立使用者user,密碼為:mypassword,其可以本地登入,並可以訪問任何資料庫

  grant all privileges on *.* to 'user'@'localhost' identified by 'mypassword'; 本地授權

  建立使用者user,密碼為:mypasword,其可以遠端登入,並可以訪問任何資料庫

 

  grant all privileges on *.* to 'user'@'%' identified by 'mypassword'; 遠端授權

  flush privileges; #刷新系統許可權表