Compile and install mysql on centos

Source: Internet
Author: User
Compile and install mysql on centos

Environment: centos6.5 mysql-5.6.17.tar.gz

Wgethttp: // cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz

Yum install-y gcc-c ++. x86_64 bison. x86_64 libaio. x86_64 cmake. x86_64 ncurses-devel.x86_64

Follow the official documents below: MySQL 5.6 Manual 2.8.2 Installing MySQL Using a Standard Source Distribution

shell> groupadd mysqlshell> useradd -r -g mysql mysql
Shell>tar zxvf mysql-VERSION.tar.gzShell>cd mysql-VERSIONShell>cmake .Shell>makeShell>make install
Shell>cd /usr/local/mysqlShell>chown -R mysql .Shell>chgrp -R mysql .Shell>scripts/mysql_install_db --user=mysqlShell>chown -R root .Shell>chown -R mysql dataShell>Bin/mysqld_safe -- user = mysql &
After the installation is complete, an error is reported during startup:
/Usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld. pid '(Errcode: 2-No such file or directory)
Cd/var/run/
Mkdir mysqld
Chown-R mysql mysqld
Chgrp-R mysql mysqld
Restart:
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'MySQL. user' doesn' t exist
Modify:/usr/local/mysql/my. cnf
Datadir =/usr/local/mysql/data
Restart your computer
Mysql. server start started successfully
./Bin/mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql. sock' (2)
Ln-s/var/lib/mysql. sock/tmp/mysql. sock
After executing this command, mysql is successfully run.

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.