MySQL compilation installation

Source: Internet
Author: User

Source code to install MySQL, according to the document to execute once

Download the source Package

Tar zxf Entry Directory

./configure--prefix=/usr/local/mysql--enable-assembler &&make && make install

Create a MySQL user, chown-r mysql.mysql/usr/local/mysql/

Then database initialization

/usr/local/ mysql/bin/mysql_install_db--user=mysql--datadir=./var--basedir=/usr/local/mysql/

Re -

And then start

/usr/local/mysql/bin/mysqld_safe--user=mysql&

Configure the source MySQL for the system service:


Cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my.cnf

Cp/usr/local/mysql/share/mysql/mysql.server/etc/rc.d/init.d/mysqld

Chkconfig--add mysqld

Chkconfig--level mysqld on

Service mysqld Restart



mysql5.5

CMake. -DCMAKE_INSTALL_PREFIX=/USR/LOCAL/MYSQL55/\

-dmysql_unix_addr=/tmp/mysql.sock \

-dmysql_datadir=/data/mysql \

-DSYSCONFDIR=/ETC \

-dmysql_user=mysql \

-dmysql_tcp_port=3306 \

-dwith_xtradb_storage_engine=1 \

-dwith_innobase_storage_engine=1 \

-dwith_partition_storage_engine=1 \

-dwith_blackhole_storage_engine=1 \

-dwith_myisam_storage_engine=1 \

-dwith_readline=1 \

-denabled_local_infile=1 \

-dwith_extra_charsets=1 \

-ddefault_charset=utf8 \

-DDEFAULT_COLLATION=UTF8_GENERAL_CI \

-dextra_charsets=all \

-dwith_big_tables=1 \

-dwith_debug=0


Make && make install


Create a MySQL user, chown-r mysql.mysql/usr/local/mysql/

/usr/local/mysql/scripts/mysql_install_db--user=mysql--datadir=./var--basedir=/usr/local/mysql/

This step initializes the database system, initializes the data directory and the root directory

Nohup/usr/local/mysql55/bin/mysqld_safe--user=mysql & server background start MySQL

Ps-ef |grep MySQL look at the success

Not yet, to the host name in the Hosts file, to ensure that the host name can ping through

And then we can MySQL.


MySQL compilation installation

Related Article

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.