The Installation Method of MySQL5.5 is slightly different from that of 5.1. The main difference lies in the configuration environment. For the installation method of MySQL5.1, refer to build the LAMP environment (source code ). This article explains how to install MySQL on RedHat6.1. First of all, we need to prepare MySQL. As for where to download it, I don't need to talk about it. This is a tough smart guy. The MySQL version used in this article is 5.5.29. If the reader has prepared the version or other versions of MySQL 5.5
The Installation Method of MySQL 5.5 is slightly different from that of MySQL 5.1. The main difference lies in the configuration environment. For the installation method of MySQL 5.1, refer to build the LAMP environment (source code method ). This article explains how to install MySQL 6.1 on RedHat 5.5.
First of all, we need to prepare MySQL. As for where to download it, we don't need to talk about it. It's hard to be a smart friend. The MySQL version used in this article is 5.5.29. If the reader has prepared the version or other versions of MySQL 5.5, the following describes how to install MySQL 5.5. All operations in this article are completed under the virtual machine.
Recommended reading:
Complete MySQL installation and master-slave dual-host configuration http://www.linuxidc.com/Linux/2013-10/91116.htm
RHEL6 platform rpm installation MySQL database http://www.linuxidc.com/Linux/2013-09/90435.htm
RedHat 6.3 installation MySQL-server-5.6.13-1.el6.x86_64.rpm http://www.linuxidc.com/Linux/2013-09/89540.htm
Install MySQL5.6 and Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm in Ubuntu 12.04
Step 1: copy the MySQL 5.5 source code package to the Virtual Machine
[root@serv01 ~]# yum install /usr/bin/scp -y[root@larrywen ule-mysql]# scpmysql-5.5.29.tar.gz 192.168.1.11:/optroot@192.168.1.11's password:mysql-5.5.29.tar.gz 100% 24MB 23.7MB/s 00:00
Step 2: make and other commands are required to compile the source code. Therefore, we need to install the development kit.
[root@serv01 ~]# yum grouplist | grep Devel Additional Development Desktop Platform Development Development tools Server Platform Development[root@serv01 ~]# yum groupinstall"Development tools" -y
Step 3: Decompress the source code package to the/usr/src directory./usr/src is the recommended command.
[root@serv01 opt]# tar -xvf mysql-5.5.29.tar.gz -C /usr/src/
Step 4: Enter the MySQL decompression directory
[Root @ serv01 opt] # cd/usr/src/mysql-5.5.29/# installation help documentation (refer to this file for installation) [root @ serv01 mysql-5.5.29] # vim INSTALL-SOURCEshell> tar zxvf mysql-VERSION.tar.gzshell> cd mysql-VERSIONshell> cmake. shell> makeshell> make install # End of source-build specific instructions # Postinstallation setupshell> cd/usr/local/mysqlshell> chown-R mysql. shell> chgrp-R mysql. shell> scripts/mysql_install_db -- user = mysqlshell> chown-R root. shell & gt; chown-R mysql data # Next command is optionalshell & gt; cp support-files/my-medium.cnf/etc/my. cnfshell> bin/mysqld_safe -- user = mysql & # Next command is optionalshell> cp support-files/mysql. server/etc/init. d/mysql. server
Step 5: Because the configuration environment requires cmake and MySQL depends on the ncurses-devel package, we install cmake and ncurses-devel
[root@serv01 mysql-5.5.29]# yum install cmake-y[root@serv01 mysql-5.5.29]# yum install ncurses-devel -y
Step 6,Key stepsThis step is also different from MySQL 5.1. Use the cmake command to configure the environment, as shown below:
[Root @ serv01 mysql-5.5.29] # cmake. \-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-Internal = 1 \-Internal = 1 \-Internal = 1 \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci \-Internal = all -DMYSQL_TCP_PORT = 3306 \-DMYSQL_UNIX_ADDR =/tmp/mysql. sock \-DMYSQL_DATADIR =/usr/local/mysql/dataExplanation:-DCMAKE_INSTALL_PREFIX =/usr/local/mysql: MySQL installation directory. We recommend that you install it in this directory-DWITH_INNOBASE_STORAGE_ENGINE = 1: Install InnoDB Storage engine-DWITH_MYISAM_STORAGE_ENGINE = 1: install MyISAM storage engine-DWITH_MEMORY_STORAGE_ENGINE = 1: install memory storage engine-DDEFAULT_CHARSET = utf8: default encoding set to utf8-DDEFAULT_COLLATION = utf8_general_ci: The Silent validation rule is utf8_general_ci-DWITH_EXTRA_CHARSETS = all: all other codes are supported-DMYSQL_TCP_PORT = 3306: MySQL port is 3306-DMYSQL_UNIX_ADDR =/tmp/mysql. sock: Specify the SOCK file path-DMYSQL_DATADIR =/usr/local/mysql/data: MySQL data DIRECTORY
For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2013-10/91656p2.htm