Centos source code compilation and installation of MySQL 5.5.15)

Source: Internet
Author: User
Install the compilation tool
    1. Yum install GCC gcc-C ++
    2. Yum install ncurses-devel
Download source code
    1. Mkdir-P/tmp
    2. CD/tmp
    3. Wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz/from/http://mysql.he.net/
    4. Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
    5. Wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
Install cmake and bison
    1. CD/tmp
    2. Tar zxvf cmake-2.8.4.tar.gz
    3. CD cmake-2.8.4
    4. ./Bootstrap
    5. Make
    6. Make install
    1. CD/tmp
    2. Tar zxvf bison-2.5.tar.gz
    3. CD bison-2.5
    4. ./Configure
    5. Make
    6. Make install
Compile and install MySQL
    1. /Usr/sbin/groupadd MySQL
    2. /Usr/sbin/useradd-G MySQL
    3. CD/tmp
    4. Tar xvf mysql-5.5.15.tar.gz
    5. CD mysql-5.5.15/
    6. Cmake-dcmake_install_prefix =/usr/local/MySQL \
    7. -Dmysql_unix_addr =/tmp/MySQL. Sock \
    8. -Ddefault_charset = utf8 \
    9. -Ddefault_collation = utf8_general_ci \
    10. -Dwith_extra_charsets = all \
    11. -Dwith_myisam_storage_engine = 1 \
    12. -Dwith_innobase_storage_engine = 1 \
    13. -Dwith_memory_storage_engine = 1 \
    14. -Dwith_readline = 1 \
    15. -Denabled_local_infile = 1 \
    16. -Dmysql_datadir =/var/MySQL/data \
    17. -Dmysql_user = MySQL
    18.  
    19. Make
    20. Make install

For detailed compilation parameter reference: http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html

Related settings
    1. chmod + w/usr/local/MySQL
    2. chown-r MYSQL: MySQL/usr/local/MySQL
    3. ln-S/usr/local/MySQL/lib/libmysqlclient. so.16/usr/lib/libmysqlclient. so.16
    4. mkdir-P/var/MySQL/
    5. mkdir-P/var/MySQL/data/
    6. mkdir-P/var/MySQL/log/
    7. chown-r MYSQL: MySQL/var/MySQL/
    8. Cd support-files/
    9. CP my-large.cnf/var/MySQL/My. CNF
    10. CP mysql. Server/etc/rc. d/init. d/mysqld
    11. /usr/local/MySQL/scripts/mysql_install_db \
    12. -- defaults-file =/var/MySQL/My. CNF \
    13. -- basedir =/usr/local/MySQL \
    14. -- datadir =/var/MySQL/data \
    15. -- user = mysql
    16. chmod + x/etc/init. d/mysqld
    1. VI/etc/init. d/mysqld (edit this file, find and modify the following variable content :)
    2. Basedir =/usr/local/MySQL
    3. Datadir =/var/MySQL/Data

Add a startup Item:

    1. Chkconfig -- add mysqld
    2. Chkconfig -- level 345 mysqld on

Start the service:

    1. Service mysqld start

Set password:

    1. /Usr/local/MySQL/bin/mysqladmin password [New-Password]

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.