Source code compilation install MySQL 5.5 or more

Source: Internet
Author: User

1. Pre-Installation Equipment

1.1 Already installed GCC (gcc-c++) make Automake

1.2 Downloads cmake:http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz

1.3 Downloads mysql:http://fossies.org/unix/misc/mysql-5.5.23.tar.gz/

1.4 Downloads Bison:http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz

2. Installing CMake

Tar zxvf cmake-2.8.8.tar.gz

CD cmake-2.8.8

./bootstrap

Gmake

Gmake Install

3. Installing Bison

Tar zxvf bison-2.5.tar.gz

CD bison-2.5

./configure

Make

Make install

4. Install MySQL

The default encoding is set to GBK and the character set is Gbk_chinese_ci

4.1 Adding a MySQL account

/usr/sbin/groupadd MySQL

/usr/sbin/useradd-g MySQL MySQL

4.2 Decompression

Tar xvf mysql-5.5.23.tar.gz

CD mysql-5.5.23/

4.3 compiling

Cmake-dcmake_install_prefix=/usr/local/mysql     -dmysql_unix_addr=/tmp/mysql.sock -ddefault_charset=gbk -ddefault_collation=gbk_ Chinese_ci -dwith_extra_charsets:string=gbk,gb2312,utf8 -dwith_myisam_storage_engine=1 -dwith_innobase_storage_engine=1 -dwith_readline=1 -denabled_local_infile=1 -dmysql_datadir=/opt/mysql/data

    Make

Make install

4.4 Adding permissions

chmod +w/usr/local/mysql

Chown-r Mysql:mysql/usr/local/mysql

Mkdir-p/opt/mysql/data/

Mkdir-p/opt/mysql/log/

Chown-r mysql:mysql/opt/mysql/

4.5 Copy my.cnf file

CD support-files/

CP my-large.cnf/opt/mysql/my.cnf (Note: my-large.cnf suitable for 1G memory of the server, you can choose according to their own configuration my-large.cnf or my-huge.cnf different configurations)

CP Mysql.server/etc/init.d/mysqld

5. Initializing the installation

/usr/local/mysql/scripts/mysql_install_db --defaults-file=/opt/mysql/my.cnf --basedir=/usr/local/mysql --datadir=/opt/mysql/data --user=mysql

6. Add MySQL to start

chmod +x/etc/init.d/mysqld

Vi/etc/init.d/mysqld (if there is a special directory, edit this file, such as the base directory, and Data directory)

Basedir=/usr/local/mysql

Datadir=/opt/mysql/data

Chkconfig--add mysqld

Chkconfig--level 345 mysqld on

7. Start MySQL

Service mysqld Start

8. Change the root password

mysqladmin-u root Password "newpwd"

9. Other issues in the installation

Could not find Curses (missing:curses_library curses_include_path)

Missing Ncurses-devel

Install Ncurses-devel with Yum

Source code compilation install MySQL 5.5 or more

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.