Compiling and installing mysql-5.5.32

Source: Internet
Author: User

Because of the mysql5.5.xx-5.6.xx product family features, the compilation method and the early product installation method are different

Compile and install MySQL-5.5.32 using CMake method

Check for the development environment you need, the small part here is centos6.5 execute the following command: Yum-y groupinstall "Development tools" "Compatibility Libraries"

1. Installation packages that need to be prepared

    Wget/home/oldboy/tools http://mysql.ntu.edu.tw./downloads/mysql-5.5/mysql-5.5.32.tar.gz    Wget/home/oldboy/tools http://

2. Installing cmake-2.8.8

   #tar XF cmake-2.8.8.tar.gz
#cd cmake-2.8.8



3. Installing mysql-5.5.32

3.1 Creating MySQL Users and Groups


3.2 Resolving dependent environments



3.3 Create the required directory and authorize

Mkdir-p/usr/local/mysql-5.5.32

Mkdri-p/data/mysql

Chown-r Mysql.mysql/data/mysql

    

3.4 Compiling the installation

#tar XF mysql-5.5.32.tar.gz
#cd mysql-5.5.32


cmake-dcmake_install_prefix=/usr/local/mysql-5.5.32/-dmysql_datadir=/data/mysql-dmysql_unix_addr=/usr/local/ MYSQL-5.5.32/TMP/MYSQL.SOCK-DDEFAULT_CHARSET=UTF8-DDEFAULT_COLLATION=UTF8_GENERAL_CI-DEXTRA_CHARSETS=GBK, Gb2312,utf8,ascii-denabled_local_infile=on-dwith_innobase_storage_engine=1-dwith_federated_storage_engine=1- Dwith_blackhole_storage_engine=1-dwithout_example_storage_engine=1-dwithout_partition_storage_engine=1-dwith_ Fast_mutexes=1-dwith_zlib=bundled-denabled_local_infile=1-dwith_readline=1-dwith_embedded_server=1-dwith_debug =0

#make-j2 && Make Install-j2

4. Configure MySQL

Create a link for mysql.5.5.32

#ln-SV/USR/LOCAL/MYSQL-5.5.32/USR/LOCAL/MYSQ

4.1 Offers MY.CNF

#cd/usr/local/mysql

   

Select the appropriate profile template for MySQL based on memory

#cp mysql-5.5.32/support-files/my-small.cnf/etc/my.cnf

4.2 Configuring environment variables

#echo ' export path=/usr/local/mysql/bin: $PATH ' >>/etc/profile.d/mysql.sh

    

#source/etc/profile

4.3MSYQL initialization

#cd/application/mysql/scripts/
#./mysql_install_db--basedir=/use/local/mysql/--datadir=/data/mysql/--user=mysql

4.4 To provide startup files for MySQL

#cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

#chmod +x/etc/init.dmysqld

5. Start MySQL

Chkconfig--add mysqld

Chkconfig on Mysqld

Chkconfig--list

Service mysqld Start

NETSTART-ENLP |grep MySQL

  

Landing

Mysql

   

Summary and analysis of common error problems

*******************************

Initialize exception

Double-Check the error--solve the problem--re-initialize
#rm-fr/data/mysql
#mkdri/data/mysql
#chown-R mysql.mysql/data/
#cd/usr/local/mysql/
#history |grep Insta to locate the previous initialization database after the command check is re-executed
#./mysql_install_db--basedir=/usr/local/mysql/--datadir=/data/mysql--user=mysql

*******************************

MySQL Boot exception

1 Wait a few seconds to see, MySQL boot will be slightly slower
2 Viewing the error log, the error log path is at the bottom of the MY.CNF configuration
#tail -100/data/3306/mysql_oldboy3306.err
3 Take a closer look at the screen output returned by all execution commands, do not ignore the key output content
4 Viewing the/var/log/messages of the system
5 if it is an affiliate service, you should also view the log of the related service
ERROR 1044 (not authorized)
Error log empty
#>mysql_oldboy3306.err
#chown-R Mysql.mysql/data
#service mysqld Start

*****************************************
Login MySQL failure, problem solving ERROR1045
#pkill mysqld Kill the process.
#lsof-I: 3306
#rm-fr/application/mysql/data/* Delete initialization files
#/usrlocal/mysql/scripts/mysql_insatll_db--datadir=/application/... Re-initialize


*********************
Common problems, ncurses-devel not installed, or Openssl-devel not installed
Look for the error keyword find; Name is and other keywords
***********************

  

  

   

  

Compiling and installing mysql-5.5.32

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.