MySQL基礎 許可權配置

2022-03-02 23:59:53 字數 852 閱讀 6061

mysql>grant all privileges on .* to ''@'localhost' identified by '';

mysql>grant all privileges on .* to ''@'localhost' identified by '';

mysql>create database icebug_db;

mysql>grant all privileges on icebug_db.* to 'icebug'@'localhost' identified by 'icebug_passwd'; # 目的是本地可訪問

mysql>grant all privileges on icebug_db.* to 'icebug'@'%' identified by 'icebug_passwd'; # 目的是遠端主機可以訪問

建立好了之後就可以直接通過使用者icebug和密碼icebug_passwd登陸資料庫系統了,注意通過icebug賬號和icebug_passwd登陸之後只能看到資料自己的資料庫,並不能看到別人的資料庫,這也是為什麼要為特定資料庫建立特定賬號和密碼了,千萬注意不要人手乙個root賬號和密碼.....

icebug@localhost:~$ mysql -uicebug -picebug_passwd
這樣就可以登陸icebug的資料庫了~

最好不要這樣直接把密碼放到命令列裡一塊敲,不然很容易在bash history中留下密碼痕跡,出於安全考慮還是通過mysql -uicebug -p之後再敲入密碼為好。

MySql 許可權配置

通過修改user表授權 mysql 許可權控制資訊儲存在表mysql.user中.mysql.user 表字段如下 host 使用者通過哪台主機訪問 user 使用者名稱 password 加密密碼 priv等字段就是對應的許可權.如下記錄 host,user,select priv 192.168...

mysql 許可權基礎

首先進入mysql命令列 1.新增使用者許可權 表示新增乙個使用者名稱和密碼都為sa的使用者,此使用者可以在區域網內登陸,並且擁有mysql除grant option之外的所有簡單許可權 grant all on to sa 192.168.1.identified by sa 2.刪除使用者許可權...

mysql配置使用者許可權 mysql使用者許可權配置

mysql使用者許可權配置 有什麼不對的地方請各位大神多多指教!1,檢視使用者表 mysql select user,password,host from mysql.user user 使用者名稱 password 密碼 加密 host 連線ip 2,開放遠端連線 vim etc mysql ma...