Mysql資料庫建立非Root使用者

2021-09-01 02:56:23 字數 452 閱讀 6136

針對於某個資料庫進行使用者的新增(不使用root進行登陸),方法入下:

建立使用者和密碼;

username : 用於登陸資料庫的使用者名稱;

password :用於登陸時輸入的密碼

create user username identified by 'password;
給新建的使用者設定關於某個資料庫的許可權;

databasename : 是資料庫的名字;

.*: 時針對這個資料庫的所有**擁有許可權;

『username』@』%』: 是這個使用者通過任何ip訪問資料庫

grant all on databasename.* to 'username'@'%';
重新整理上面的操作,使其生效

flush privileges;

建立mysql資料庫總結 MySQL資料庫總結

引擎 檢視mysql預設引擎 show variables like storage engine 檢視表引擎 show table status from 資料庫名 修改表引擎 alter table 表名 engine innodb 建立時直接定義引擎 create table 表名 engin...

修改MySQL資料庫Root密碼

方法一 在my.ini的 mysqld 字段加入 skip grant tables 重啟mysql服務,這時的mysql不需要密碼即可登入資料庫 然後進入mysql mysql use mysql mysql 更新 user set password password 新密碼 where user...

Mysql資料庫root密碼管理

在管理資料庫工作中,如果忘記資料庫root將是十分災難的一件事情.所以如何在忘記root密碼的情況下恢復密碼呢?停止mysql服務程式 修改配置檔案,跳過授權表 啟動mysql服務程式 修改root密碼 驗證root密碼 1 停止mysql服務程式 systemctl stop mysqld 2 修...