Install MySQL5.5.30 by compiling the source code

Source: Internet
Author: User
Install MySQL5.5.300, install cmake [root@www.linuxidc.com ~] #Tar-zxvfcmake-2.8.11.2.tar.gz [root@www.linuxidc.co

Install MySQL 5.5.30 through source code compilation. Install cmake [root @ www.linuxidc.com ~] # Tar-zxvf cmake-2.8.11.2.tar.gz [root @ www. linuxidc. co

Homepage → Database Technology

Background:

Read News

Source code compilation and installation of MySQL 5.5.30

[Date: 2013-07-27] Source: Linux community Author: lyq314 [Font:]

Source code compilation and installation of MySQL 5.5.30

0. Install cmake
[Root @ ~] # Tar-zxvf cmake-2.8.11.2.tar.gz
[Root @ cmake-2.8.11.2] #./configure
[Root @ cmake-2.8.11.2] # make
[Root @ cmake-2.8.11.2] # make install


1. Add mysql users and groups
[Root @ ~] # Groupadd mysql
[Root @ ~] # Useradd-g mysql

2. Compile the MySQL Program

[Root @ tar_mysql] # tar-zxvf mysql-5.5.30.tar.gz
[Root @ ~] # Cd mysql-5.5.30/
/Usr/local/bin/cmake \
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql5.5 \
-DMYSQL_UNIX_ADDR =/tmp/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_EXTRA_CHARSETS: STRING = utf8, gbk, gb2312 \
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_READLINE = 1 \
-DENABLED_LOCAL_INFILE = 1 \
-DMYSQL_DATADIR =/home/mysql/data \
-DWITH_DEBUG = 0
[Root @ mysql-5.5.30] # make & make install

3. Copy and modify the database configuration file.

[Root @ ~] # Cp-ar/usr/local/mysql5.5/support-files/my-medium.cnf/usr/local/mysql5.5/etc/lyq314.cnf

4. initialize the database

/Usr/local/mysql5.5/scripts/mysql_install_db -- defaults-file =/usr/local/mysql5.5/etc/lyq314.cnf -- basedir =/usr/local/mysql5.5/-- datadir =/home /mysql/data -- user = mysql

5. Add Environment Variables
[Root @ ~] # Echo "export PATH = $ PATH:/usr/local/mysql5.5/bin">/etc/profile
[Root @ ~] # Source/etc/profile
6. Start mysql
/Usr/local/mysql5.5/bin/mysqld_safe -- defaults-file =/usr/local/mysql5.5/etc/lyq314.cnf -- datadir =/home/mysql/data -- user = mysql &
7. view the mysql service port
# Netstat-tunlp
[Root @ localhost etc] # netstat-nltp | grep 3306
Tcp 00 0.0.0.0: 3306 0.0.0.0: * LISTEN24752/mysqld

8. Set the administrator password.
/Usr/local/mysql5.5/bin/mysqladmin-u root password '1q2w3e4r'
#/Usr/local/mysql5.5/bin/mysqladmin-u root-p1q2w3e4r password '123'
9. log on to the database for testing
[Root @ mysql-5.5.30] #/usr/local/mysql5.5/bin/mysql-uroot-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 11
Server version: 5.5.30-log Source distribution
Copyright (c) 2000,201 3, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> show databases;
+ -------------------- +
| Database |
+ -------------------- +
| Information_schema |
| Mysql |
| Performance_schema |
| Test |
+ -------------------- +
4 rows in set (0.02 sec)
Mysql>

10. Disable MySQL
[Root @ mysql-5.5.30] #/usr/local/mysql5.5/bin/mysqladmin-uroot-p shutdown
Enter password:
130717 00:31:09 mysqld_safe mysqld from pid file/home/mysql/data/lyq314.pid ended

Related reading:

Three major installation methods for MySQL 5.5: [binary, source code compilation, and RPM package] installation steps and comparison of advantages and disadvantages

  • 0
  • Oracle 10g 10.2.0.1 32-bit migration upgrade to 10g 10.2.0.5 64-bit

    Add the MySQL service to the System Service of the server in Linux

    Related information MySQL 5.5.30 MySQL source code compilation and Installation

  • MySQL 5.5.30 released (12:46:24)
  • Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2011 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    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.