Redhat Linux上mysql安裝-binary package安裝

前面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

 

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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章