Before we deploy, we're talking about several ways to install MySQL:
Compile and install: The advantage is can be customized, according to the company requirements of personalized settings; Cons: Compile complex, solve dependency problems
Binary installation: Advantages do not need to compile, decompression can be, the drawback package is large
Yum installation: Combined with the above 2 advantages, but need to customize the RPM package, put in the Yum Warehouse,
Then simply execute a command yuminstall mysql-server-y to complete.
So how do we choose the installation of MySQL?
The database requirements are not too high yum/rpm way installation mysql For example, concurrency is small, just inside the company , Enterprise internal application ( zabbix monitoring system, Openstack Background management) and other applications that require a database; of course, it is also possible to select Yum rpm
However, there are many large web sites or portals that are often installed in MySQL , there will be a variety of customization , initialization needs, at this time, according to the needs of the enterprise to make the source package into rpm package , and then build their own Yum Warehouse , the final use of Yum install mysql-server-y installation, the advantages of this is that the yum/rpm installation of the advantages of the simple, but also used the source package installation method of the customizable
Say it today, compile and install
First, the system environment and software version
[Email protected] scripts]# cat/etc/redhat-release CentOS release 6.8 (Final) [[email protected] scripts]# Uname-alinux DB02 2.6.32-642.el6.x86_64 #1 SMP Tue may 17:27:01 UTC x86_64 x86_64 x86_64 gnu/linux
Software version
mysql:mysql-5.5.32cmake:cmake.x86_64 2.8.12.2-4.el6 #编译工具
II. installation and deployment of MySQL
1, install the dependency package
Yum install ncurses-devel Libaio-develrpm-qa ncurses-devel libaio-devel
2, install CMake, then need to use it to compile MySQL
Yum Install Cmake-y
3. Create a MySQL user, download the package
Useradd mysql-s/sbin/nologin-m-u 503id mysqlmkdir-p/home/oldboy/toolscd/home/oldboy/tools/#rz upload source package, package can be used mirror open source Zone GET or below my Baidu Cloud share # #链接: http://pan.baidu.com/s/1qYhRwvi password: 19dntar XF mysql-5.5.32.tar.gz CD mysql-5.5.32
4,cmake compiling installation and parameters
#-ddefault_collation=utf8_general_ci \: Specifies that the default creation database character set is utf-8, without adding, create database, default to Latin character set
CMake. -dcmake_install_prefix=/application/mysql-5.5.32-dmysql_datadir=/application/mysql-5.5.32/data-dmysql_unix_ Addr=/application/mysql-5.5.32/tmp/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dextra_ Charsets=gbk,gb2312,utf8,ascii-denabled_local_infile=on-dwith_innobase_storage_engine=1-dwith_federated_ Storage_engine=1-dwith_blackhole_storage_engine=1-dwithout_example_storage_engine=1-dwithout_partition_storage _engine=1-dwith_fast_mutexes=1-dwith_zlib=bundled-denabled_local_infile=1-dwith_readline=1-dwith_embedded_ Server=1-dwith_debug=0make && make install&& CD.
#补充: If the system has ever installed database files and startup programs are best to stop or delete, so as not to conflict.
Ln-s/application/mysql-5.5.32//application/mysql
#--Build files has been written to:/home/oldboy/tools/mysql-5.5.32
Tip, there are many options to configure at compile time, refer to the end of the appendix or official documentation:
This article is from the "funny Brother Notes" blog, be sure to keep this source http://qiuyt.blog.51cto.com/1229789/1920686
CentOS 6.8 Compilation Installation MySQL5.5.32 (i)