mysql5 7 修改密碼,修改許可權

2022-05-08 21:39:14 字數 914 閱讀 9153

1.修改資料庫對指定使用者和ip許可權

a. ip為192.168.0.1的使用者jack擁有對資料庫datebase的表table的 增刪改查許可權, ,連線密碼為password

grant select,insert,update,delete,create,drop on database.table to [email protected] identified by 'password';

b. 192.168.0.1的使用者jack擁有對資料庫datebase所有表的所有操作許可權,連線密碼為password

grant all privileges on datebase.* to [email protected] identified by 'password';

c. 192.168.0.1的使用者jack擁有對所有資料庫所有表的所有操作許可權,連線密碼為password 

grant all privileges on *.* to [email protected] 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;

mysql修改許可權 MySql 修改許可權

mysql 賦予使用者許可權命令的簡單格式可概括為 grant 許可權 on 資料庫物件 to 使用者 一 grant 普通資料使用者,查詢 插入 更新 刪除 資料庫中所有表資料的權利。grant select on testdb.to common user grant insert on tes...

mysql5 7修改密碼

關閉正在執行的mysql服務。net stop mysql 開啟dos視窗,轉到mysql bin目錄。輸入mysqld skip grant tables 回車。skip grant tables 的意思是啟動mysql服務的時候跳過許可權表認證。my.ini 中放開這行 再開乙個dos視窗 因為...

mysql5 7密碼修改

檢視臨時密碼 root god grep password var log mysqld.log 2020 09 11t10 58 46.152697z 1 note a temporary password is generated for root localhost p jp 6d 4rw登入...