MySQL5.5.15 source code package compilation and Installation

Source: Internet
Author: User
Tags most popular database
Mysql is indeed the most popular database. Since mysql5.5.8, mysql's source code package compilation and installation have to be compiled using cmake. The compilation process is not essential.

Mysql is indeed the most popular database. Since mysql5.5.8, mysql's source code package compilation and installation have to be compiled using cmake. The compilation process is not essential.

Mysql is indeed the most popular database. Since mysql5.5.8, mysql's source code package compilation and installation have to be compiled using cmake. There is no essential difference in the compilation process, but it is much more intuitive. Mysql has been installed many times before, and there will be some minor errors each time. Record the installation process for future reference.

1. source code package preparation

(1)mysql-5.5.15.tar.gz mysqlmysql source package. Download the latest mysql5.5.15. Be sure not to deploy the installation package. That's me, tragedy!

(2)cmake-2.8.4.tar.gz, cmake installation package. You can download the latest version.

(3) install the required library files

# Yum install-y gcc-c ++ gcc-g77 autoconf automake zlib * fiex * libxml * ncurses-devel libmcrypt * libtool-ltdl-devel *

2. compilation process

(1) create directories, users, and permissions.

# Mkdir-p/usr/local/mysql # create a mysql installation directory

# Mkdir-p/data/mysql # create a mysql database directory

# Groupadd mysql # Add a mysql Group

# Useradd-g msyql # Add a mysql user to the mysql Group

# Chown-R mysql. mysql/data/mysql # assign the ownership of the/data/mysql directory to the mysql user in the mysql Group

(2) install cmake

# Tar cmake-2.8.4.tar.gz

# Cd cmake-2.8.4

#./Configure

# Make & make install

(3) install mysql

# Cd mysql-5.5.15

# Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_UNIX_ADDR =/data/mysql. sock-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-DWITH_EXTRA_CHARSETS: STRING = utf8, gbk-records = 1-records = 1-records = 1-DWITH_READLINE = 1-DENABLED_LOCAL_INFILE = 1-DMYSQL_DATADIR =/data/mysql-DMYSQL_USER = mysql-DMYSQL_TCP_PORT = 3306 'things really look I can't help beginners.

# Make & make install

# Cp support-files/my-medium.cnf/etc/my. cnf # If your machine's memory teaches big, you can copy My-huge.cnf files

# Chmod 755 scripts/mysql_install_db

# Scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/data/mysql/# initialize the database

# Cp support-files/mysql. server/etc/init. d/mysql # set to start mysql at startup

# Chmod 755/etc/init. d/mysql

# Chkconfig mysql on # Start upon startup

# Echo 'export PATH =/usr/local/mysql/bin: $ path'>/etc/profile # Add the mysql installation PATH to the PATH ,, easy to start mysql (restart takes effect)

#/Etc/init. d/mysql start # start mysql

You can check whether mysql is started in the process.

Set a mysql root Password

# Mysqlamdin-u root password '123'

Here I encountered a problem: some errors may occur after I delete mysql and reinstall it. When mysql is started after compilation, a prompt is displayed.

Starting MySQL .. The server quit without updating PID file (/data/mysql/localhost. localdomain. pid

In this case, you need to edit the [mysqld] module in vi/etc/my. cnf and add your datadir path to it, as shown in figure

Datadir =/data/mysql

If the path does not contain the localhost. localdomain. pid file, you may need to touch one file and grant the mysql user the permission.

Last ps-aux | grep mysql

Kill the mysql process

#/Etc/init. d/mysql start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.