mysql5.6.8 source code installation process

mysql5.6.8 source code installation process

Kernel:

[root@opop ~]# cat /etc/centos-release 
CentOS release 6.8 (Final)
[root@opop ~]# uname -a
Linux 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 the 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 gcc-c++ ncurses-devel cmake make perl bison git

Create the 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/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=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: The compilation time is long, please wait patiently//Check the result:
//[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 after

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

Reload profile (effective immediately)

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

Restart the mysql service:

[root@opop mysql]# service mysql restart

First time login:

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

Authorization:

mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
//Add remote connection capability to root, please operate with caution.

Set the database password:

mysql> update user set password = password('111111') where User='root'; //Update the root password to 6 1s

refresh:

mysql> flush privileges;

quit:

mysql> exit

After changing your password, log in again:

[root@opop mysql]# mysql -u root -p 
Enter password: //Enter 6 1s here to enter

Set the service to start automatically at boot:

[root@opop mysql]# chkconfig mysql on

Summarize

The above is the mysql5.6.8 source code installation process introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Install MySQL database 5.6 source code under Linux and change the login user password
  • 64-bit CentOs7 source code installation mysql-5.6.35 process sharing
  • Centos 6.4 source code installation mysql-5.6.28.tar.gz tutorial
  • Tutorial on installing mysql5.6.20 from source code under linux
  • Install MySQL 5.6 source code using RPM
  • How to install MySQL 5.6 from source code under SUSE Linux
  • Share the source code installation process of the latest MySQL version 5.6.13 under CentOS

<<:  Detailed explanation of Linux command file overwrite and file append

>>:  How does JS understand data URLs?

Recommend

Comparison of mydumper and mysqldump in mysql

If you only want to back up a few tables or a sin...

How to use docker+devpi to build local pypi source

Some time ago, I needed to use pip downloads freq...

Toolkit: A more powerful front-end framework than Bootstrap

Note: Currently, the more popular front-end frame...

JavaScript imitates Jingdong magnifying glass effect

This article shares the specific code for JavaScr...

Util module in node.js tutorial example detailed explanation

Table of contents Starting from type judgment Str...

Detailed explanation of mysql filtering replication ideas

Table of contents mysql filtered replication Impl...

Share 5 helpful CSS selectors to enrich your CSS experience

With a lot of CSS experience as a web designer, we...

How to use cookies to remember passwords for 7 days on the vue login page

Problem Description In the login page of the proj...

Repair solution for inconsistent MySQL GTID master and slave

Table of contents Solution 1: Rebuild Replicas Pr...

Introduction to the steps of deploying redis in docker container

Table of contents 1 redis configuration file 2 Do...

MySQL DeadLock troubleshooting full process record

【author】 Liu Bo: Senior Database Manager at Ctrip...

How to use the Linux seq command

1. Command Introduction The seq (Sequence) comman...

Win2008 R2 mysql 5.5 zip format mysql installation and configuration

Win2008 R2 zip format mysql installation and conf...

Analysis of the Linux input subsystem framework principle

Input subsystem framework The linux input subsyst...

5 ways to quickly remove the blank space of Inline-Block in HTML

The inline-block property value becomes very usef...