Redhat Linux上mysql安裝-binary package安裝

來源:互聯網
上載者:User

標籤:mysql binary 安裝

前面講了mysql rpm安裝包的安裝方法,本文學習下二進制安裝,其實二進制安裝更簡單,二進制是已經被編譯過的代碼,可以直接解壓配置後使用,總結其特點就是:

1.安裝簡單

2. 可以指定安裝目錄,比較靈活

3.一台伺服器上可以安裝多個MYSQL

但是存在問題是,已經編譯過,效能顯然不如源碼編譯安裝的好,也不能靈活定製編譯參數,代碼已經被編譯過,將其解壓到一個目錄下即可以看到其安裝包中檔案,具體檔案目錄保護如下內容:

Directory

Contents of Directory

bin, scripts

mysqld server,  client and utility programs

data

Log  files, databases

docs

MySQL  manual in Info format

man

Unix  manual pages

include

Include  (header) files

lib

Libraries

share

Miscellaneous  support files, including error messages, sample configuration files, SQL for  database installation

 

解壓即安裝:

shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz shell> ln -s full-path-to-mysql-VERSION-OS mysql

 

比起RPM安裝包來說,二進制包安裝需要手工創建用戶:

shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql shell> mkdir mysql-files
shell> chmod 750 mysql-files
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql    # Before MySQL 5.7.6
shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and up
shell> bin/mysql_ssl_rsa_setup              # MySQL 5.7.6 and up
shell> chown -R root .
shell> chown -R mysql data mysql-files
shell> bin/mysqld_safe --user=mysql & # Next command is optional shell> cp support-files/mysql.server /etc/init.d/mysql.server

 

這樣就完成了安裝啦,可以看到主要是用戶權問題需要配置好。


本文出自 “Marvelyu's Notes” 部落格,請務必保留此出處http://marvelyu.blog.51cto.com/471030/1747808

Redhat Linux上mysql安裝-binary package安裝

聯繫我們

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