1. 程式人生 > >Linux 安裝 mysql 資料庫

Linux 安裝 mysql 資料庫

1. 克隆虛擬機器

 

2. 上傳安裝檔案

  1.上傳檔案

  2.解壓檔案

  tar -xvf 檔案

 

3. 安裝資料庫

安裝順序:
1.debuginfo
2.shared
3.client
4.server

1. rpm -ivh Percona-Server-56-debuginfo-5.6.24-rel72.2.el6.x86_64.rpm

2. rpm -ivh Percona-Server-shared-56-5.6.24-rel72.2.el6.x86_64.rpm

3.安裝客戶端

  rpm -ivh Percona-Server-client-56-5.6.24-rel72.2.el6.x86_64.rpm

4. rpm -ivh Percona-Server-server-56-5.6.24-rel72.2.el6.x86_64.rpm

 

5. 啟動資料庫

service mysql start    啟動資料庫
service mysql stop     停止資料庫
service mysql restart  重啟資料庫

 

6. 設定資料庫密碼

mysqladmin -u root password 密碼

 

7. 登陸資料庫

 

 8. 匯入資料庫檔案

  1. windows中資料庫檔案通過工具匯出
    .
  2. 將匯出的jtdb.sql檔案匯入mysql檔案下.

 

  3.進入 mysql 客戶端中,匯入jtdb.sql

   語法:

source /路徑/jtdb.sql;

 

9. 關閉防火牆

service iptables stop

 

10. 開啟 mysql 對外訪問許可權

mysql 指令
grant all on *.* to 'root'@'%' identified by 'root';