Install MySQL 5.5 using CMake
This article introduces how to install MYSQL 5.5.36 database through rpm.
I. Environment Description
OS: Oracle LINUX SERVER _ 64 6.3 software source code package storage location/usr/local/src Source code package compilation installation location (prefix)/usr/local/database file location: /data/mysql/Database log location:/data/log Database backup Directory:/data/backup
(We recommend that you make a detailed plan for the overall storage before installation, so you will be able to enjoy unlimited benefits in the future)
Ii. Installation Steps
1. Uninstall the default mysql and apache rpm packages.
# Yum remove httpd mysql-server php-cli php-common php-devel php-gd-y
# Yum install gcc-c ++ make ncurses-devel ntp-y
2. Install gcc
# Yum install gcc
# Yum install gcc-c ++
3. download the software to the/usr/local directory.
# Wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
# Wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.36.tar.gz/from/http://mysql.stu.edu.tw/
4. Install cmake (MYSQL5.5 is compiled through CMAKE, so you need to install CMAKE first)
# Cd/usr/local/src
# Tar xvf cmake-2.8.5.tar.gz
# Cd cmake-2.8.5
#./Configure
# Make
# Make install
5. Install the database
# Cd/usr/local/src
# Tar zxvf mysql-5.5.36.tar.gz
# Cd mysql-5.5.36
Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-DMYSQL_DATADIR =/data/mysql \-connector = 1 \-DWITH_INNOBASE_STORAGE_ENGINE = 1 \-connector = 1 \-connector = 1 \- DENABLED_LOCAL_INFILE = 1 \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci \-DEXTRA_CHARSETS = all
# Make compilation # make install Installation
6. Complete installation and configuration
# Userdel-r mysql
# Groupadd-r-g 3306 mysql
# Useradd-u 3306-g mysql-r-M-s/sbin/nologin mysql
# Mkdir/data/mysql/
# Mkdir/data/log
# Chown-R mysql: mysql/data/
# Cp support-files/my-huge.cnf/etc/my. cnf
#/Usr/local/mysql/scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/data/mysql & // initialize the database
# Cp support-files/mysql. server/etc/init. d/mysqld
# Chmod + x/etc/init. d/mysqld
# Chkconfig -- add mysqld
# Chkconfig mysqld on
# Service mysqld start // start the database
# Netstat-tnlp | grep 3306
# Cd/usr/local/bin // enter the user's default search path and establish a soft connection to the mysql command. You can directly execute the mysql Command
# Ln-s/usr/local/mysql/bin/mysql
# Ln-s/usr/local/mysql/bin/mysqldump
# Ln-s/usr/local/mysql/bin/mysqladmin
# Ln-s/usr/local/mysql/bin/mysqlbinlog
# Mysqladmin-u root-p password '000000' // set the Database password. You can leave the password unspecified.
# Mysql-u root-p mysql> flush privileges;
7. database parameter optimization
# Vi/etc/my. cnf modify the file location log-error =/data/log/mysql. err. log slow_query_log_file =/data/log/slow. log
Iii. Summary
After completing the preceding steps, you can install the database.
-------------------------------------- Split line --------------------------------------
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave server in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
MySQL-5.5.38 universal binary Installation
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: