Mysql5.6.8 source code installation process, mysql5.6.8 source code process

Source: Internet
Author: User

Mysql5.6.8 source code installation process, mysql5.6.8 source code process

Kernel:

[root@opop ~]# cat /etc/centos-release CentOS release 6.8 (Final)[root@opop ~]# uname -aLinux opop 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Start installation:

[Root @ opop ~] # For I in 'rpm-qa | grep mysql'; do yum remove $ I; done // first Delete the built-in mysql [root @ opop ~] # Yum-y install wget gcc-c ++ ncurses-devel cmake make perl bison git

Create a mysql user group:

[root@opop ~]# groupadd mysql [root@opop ~]# useradd -r -g mysql mysql

Create the mysql installation directory and database file storage directory:

[root@opop ~]# mkdir -p /usr/local/mysql[root@opop ~]# mkdir -p /usr/local/mysql/data

Modify the directory owner and group:

[root@opop ~]# chown -R mysql:mysql /usr/local/mysql/data [root@opop ~]# chown -R mysql:mysql /usr/local/mysql

Unpack:

[root@opop ~]# tar -zxvf mysql-5.6.38.tar.gz[root@opop ~]# cd mysql-5.6.38

Compile:

[Root @ opop mysql-5.6.38] # cmake \-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci \-rows = 1 \-rows = 1 \-rows = 1 \-DMYSQL_DATADIR =/usr/local/mysql/data \- DMYSQL_TCP_PORT = 3306 \-DMYSQL_USER = mysql \-DENABLE_DOWNLOADS = 1 [root @ opop mysql-5.6.38] # make & make install // note: compilation Time is long, you need to wait patiently // view the results: // [root @ opop mysql-5.6.38] # ll/usr/local/mysql/

Clear temporary files:

[root@opop mysql-5.6.38 ]# make clean

Initialize mysql:

[root@opop ~]# cd /usr/local/mysql/[root@opop mysql]# scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data [root@opop mysql ]# chown -R mysql:mysql /usr/local/mysql [root@opop mysql ]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql[root@opop mysql ]# /etc/init.d/mysql start[root@opop mysql ]# ps -aux |grep mysql

Configure environment variables:

[root@opop mysql]# vim /etc/profile

Add

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib export PATH

Reload the profile (effective immediately)

[root@opop mysql]# source /etc/profile

Restart the mysql service:

[root@opop mysql]# service mysql restart

First Login:

[root@opop mysql]# mysql -u root mysql

Authorization:

Mysql> grant all privileges on *. * TO root @ "%" identified by "root"; // Add the remote connection capability TO the root user, so proceed with caution.

Set the database password:

Mysql> update user set password = password ('000000') where User = 'root'; // update the root password to 6 passwords.

Refresh:

mysql> flush privileges;

Exit:

mysql> exit

After changing the password, log on again:

[Root @ opop mysql] # mysql-u root-p Enter password: // Enter 6 values of 1 to Enter

Set automatic start of service upon startup:

[root@opop mysql]# chkconfig mysql on

Summary

The above is a small Editor to introduce you to the mysql5.6.8 source code installation process, I hope to help you, if you have any questions, please leave a message, the small editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.