MySql 環境部署 使用者篇

2021-10-19 18:11:23 字數 620 閱讀 3231

總結用於記錄常用的mysql指令。

使用使用者名稱、密碼登入

mysql -uroot -p
輸入密碼,切換資料庫

use mysql;
查詢所有使用者

select host,user from user;
**如下(示例):

drop user 使用者名稱
**如下(示例):

create user 'test'@'%'  identified by '1234'

; #遠端登入

使用者授權

grant all privileges on 資料庫名稱.* to 'test'@'%' identified by '1234'

;或者限制ip

grant all privileges on 資料庫名稱.* to 'test'@'192.168.0.%' identified by '1234'

; flush privileges;

#重新整理系統許可權表

該處使用的url網路請求的資料。

docker環境部署mysql

這裡我拉取了tag為5.7的映象 docker pull mysql 5.7因為需要自定義mysql的配置,所以需要乙個配置目錄 因為需要將mysql生成的資料掛載到本地,所以需要乙個資料目錄 建立mysql 資料目錄 mkdir p root mysql data 建立配置檔案 touch roo...

環境部署 Redis環境部署

目錄 redis環境部署 準備部署目錄 修改配置檔案 啟動服務 檢查 附錄redis常用指令 解壓後目錄基本如下 編譯後在src目錄中可看到編譯產物 可執行的二進位制檔案 主要是這幾個 redis server redis sentinel redis cli redis benchmark red...

php環境篇 linux編譯安裝mysql5 7

新增使用者 useradd s usr sbin nologin r mysql wget tar zxf mysql boost 5.7.21.tar.gz cd mysql 5.7.21安裝擴充套件依賴yum remove mariadb libs yum install gcc y yum i...