RPM格式安裝MySql-5.6.30 資料庫

來源:互聯網
上載者:User

標籤:設定檔   server   資料庫   二進位   軟體包   

  1. 作業系統CentOS6.7 64位 

  2. 軟體包:MySQL-5.6.30-1.linux_glibc2.5.x86_64.rpm-bundle.tar

    先用ssh遠程傳輸到Linux系統上(二進位方式傳輸)

  3. 在/usr/local下建立mysql目錄將MySQL-5.6.30-1.linux_glibc2.5.x86_64.rpm-bundle.tar

    解壓到/usr/local/mysql 下

    tar  -xf  ./MySQL-5.6.30-1.linux_glibc2.5.x86_64.rpm-bundle.tar  /usr/local/mysql/

    會產生以下檔案

    我們只需要安裝server、client、devel三個檔案即可

  4. 先檢驗原有系統安裝的mysql檔案

    2卸載該庫檔案yum  -y remove  mysql-libs* 該卸載會導致部分的服務也被卸載

    安裝mysql服務端

    安裝mysql用戶端

複製mysql的設定檔

cp  /usr/share/mysql/my-default.cnf  /etc/my.cnf

資料庫初始化

/usr/bin/mysql_install_db

這時的mysql使用者登入要求輸入密碼

cat  /root/.mysql_ secret   紅色的部分即為mysql的root密碼

 

 

 

 

串連資料庫並且更改密碼

mysql -u root -p_ttOLbbnRLFxNk4U

  更改密碼  SET PASSWORD=PASSWORD(‘123123‘);

允許遠程登入的設定

  1. 更改使用者的密碼

  2. UPDATE  user set password=password(‘123456’) whereuser=”root”;

  3. update user setpassword=password(‘123456‘)where user="root";

  4. 更改遠程登入的主機限制

  5. update user set host=‘%‘ whereuser="root" and host=‘localhost‘;

  6. 重新整理授權flush privileges;

     

     

    設定開機自啟動(7的版本和6的版本區別比較大)

    Systemctl   enablemysql   7

    Chkconfig   mysql   on

     

    預設安裝的位置

    /var/lib/mysql   #資料庫目錄

              /usr/share/mysql    #設定檔的目錄

              /usr/bin                           #相關的命令目錄

/etc/init.d/mysql   #啟動指令碼


本文出自 “IT菜鳥” 部落格,請務必保留此出處http://9089323.blog.51cto.com/9079323/1782660

RPM格式安裝MySql-5.6.30 資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.