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

 

这样就完成了安装啦,可以看到主要是用户权问题需要配置好。


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