Centos6.5 安裝 MariaDB-10.0.20-linux-x86_64.tar.gz

來源:互聯網
上載者:User

標籤:

  1. 下載mariadb :https://downloads.mariadb.org/  我選擇mariadb-10.0.20-linux-x86_64.tar.gz這個版本
  2. 複製安裝檔案 /opt 目錄下 並解壓到目前的目錄 tar -zxf mariadb-10.0.20-linux-x86_64.tar.gz
  3. 把解壓的檔案名稱改為mariadb
  4. groupadd mysql 
  5. useradd -g mysql mysql
  6. cd /opt/mariadb
  7. chown -R mysql:mysql /opt/mariadb/data
  8. 把mariadb/support-files下的my-medium.cnf複製到mariadb目錄下,並改為my.cnf
  9. ./scripts/mysql_install_db --defaults-file=./my.cnf                 //初始化資料庫
  10. cp support-files/mysql.server /etc/rc.d/init.d/mysqld
  11. chmod +x /etc/rc.d/init.d/mysqld
  12. cp support-files/my-large.cnf /etc/my.cnf 
  13. 修改 /etc/rc.d/init.d/mysqld  
    1. basedir=/opt/mariadb
    2. datadir=/opt/mariadb/data
  14. service mysqld start
  15. 修改環境變數 添加mariadb的bin目錄 編輯/etc/profile,添加export PATH=$PATH:/opt/mariadb/bin/
  16. 修改root使用者密碼 ./bin/mysqladmin -u root password ‘123456‘
  17. 登入mysql ./bin/mysql -u root -p
  18. 設定資料庫許可權:
    1. MySQL [(none)]> use mysql;  
    2. MySQL [mysql]> update user set host=‘%‘ where user=‘root‘ and host=‘127.0.0.1‘; 
    3. MySQL [mysql]> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option;  
    4. MySQL [mysql]> flush privileges;

 

 

 

 

Centos6.5 安裝 MariaDB-10.0.20-linux-x86_64.tar.gz

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.