Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ Through the source code to install MySQL 5.6.26 under CentOS6     - Unable to solve the official version of Android Studio online update problem (Linux)

- Ubuntu 14.04 / 14.10 how to install Mate 1.10.0 (Linux)

- Relationship between Linux permissions with the command (Linux)

- Linux environment MySQL master-slave synchronization (Database)

- Linux 64-bit porting (Programming)

- Ora-1092: OPI colleague K aborting process --- killed by OO Well killer (Database)

- Four Methods of Self - Learning Linux (Linux)

- Shell programming entry (Programming)

- Learn to read the source code of vmstat (Linux)

- Install multiple Linux distributions and Fedora 21 first experience on the same hard disk (Linux)

- File encryption and decryption of Linux security mechanisms (Linux)

- Android memory optimization of the memory cache (Linux)

- How to clear the v $ archived_log view expiration information (Database)

- Linux how to view your JDK installation (Linux)

- Linux system find command Detailed (Linux)

- Linux and SELinux Exploration Program Manager (Linux)

- SecureCRT remote connection Ubuntu fails to solve the case (Linux)

- GCC library link order problems (Programming)

- Eight kinds of techniques to solve hard problems Linux (Linux)

- Zabbix monitoring disk IO status (Server)

  Through the source code to install MySQL 5.6.26 under CentOS6
  Add Date : 2018-11-21      
  CentOS6 under through yum install MySQL, version 5.1, older, and so want to install from source code version of the high 5.6.26.

A: uninstall the old version

Use the following command to check whether the installed MySQL Server

rpm -qa | grep mysql

Available through the following command to uninstall

rpm -e mysql // delete mode Normal
rpm -e --nodeps mysql // strong delete mode, if you use the above command to delete, suggesting other files rely on, use the delete command can be strong

Second, install the tools needed to compile MySQL

Install g ++ and gdb

yum install gcc-c ++
yum install gdb

Install cmake

yum install cmake

Install ncurses

yum install ncurses-devel

Installation bison

yum install bison bison-devel

Compilation dependencies tools. Please refer http://dev.mysql.com/doc/refman/5.6/en/source-installation.html

Third, the installation MySQL

1) Refer to the following two links to download MySQL 5.6.26

Use wget to download, download the following address:


If you want to download a different version of how to do? (The version number below the red part is removed, you will find all of the current version of the installation file)


tar xvf mysql-5.6.26.tar.gz
cd mysql-5.6.26

2) compile and install (following the path can be modified)

cmake \
-DCMAKE_INSTALL_PREFIX = / Usr / local / mysql \
-DMYSQL_DATADIR = / Usr / local / mysql / data \
-DMYSQL_UNIX_ADDR = / Tmp / mysql.sock \
-DDEFAULT_COLLATION = Utf8_general_ci


Compilation is complete, you can install

make install

Translation parameters, please refer http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html

Compilation process takes about 15 minutes to compile and install can look at the results after the completion of

ll / usr / local / mysql

Fourth, configure MySQL

1) Configure user

Use the following command to check whether mysql users and groups

cat / etc / passwd list of users
cat / etc / group to view the list of user groups

Create results confirm

id mysql

Modify / usr / local / mysql directory permissions

chown -R mysql: mysql / usr / local / mysql

2) Initial Configuration

perl test scripts running MySQL installation required

yum install perl

Enter the installation path

cd / usr / local / mysql

Perform initial configuration script to create the system comes with a database and tables

scripts / mysql_install_db --basedir = / usr / local / mysql --datadir = / usr / local / mysql / data --user = mysql

NOTE: When you start the MySQL service will search according to a certain order my.cnf, first looking in the / etc directory, find will search for "$ basedir / my.cnf", in this case, it is / usr / local / mysql / my.cnf, which is the default location of the new version of MySQL configuration file!

Note: After CentOS6.4 minimum operating system installation is complete, in the / etc directory there will be a my.cnf, need this file renamed to other names, such as: /etc/my.cnf.bak, otherwise, the document can interfere with the proper configuration of MySQL source installation, resulting not start.

After using "yum update" to update the system, you will more need to check the / etc directory a my.cnf, if more, rename it to something else. Otherwise, MySQL will use this configuration file to start, not start properly may cause problems.

3) Start MySQL

Add the service, copy the script to the init.d directory service, and set the boot

cp support-files / mysql.server /etc/init.d/mysql
chkconfig mysql on
service mysql start - start MySQL

4) Configure MySQL account password

After a successful start MySQL, the default root no password, we need to set the root password.

Before setting, we need to set the PATH, or else can not be directly invoked mysql

Modify / etc / profile file, the file added to the end

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

Close the file, run the following command to make the configuration take effect immediately

source / etc / profile

Now, we can enter the terminal directly into the mysql, mysql the environment

Run the following command to change the root password

mysql -uroot
mysql> SET PASSWORD = PASSWORD ( 'abcd @ 1234');

To set the root user can remotely access, execution

. Grant all privileges on * * to 'root' @ '%' identified by 'abcd @ 1234' with grant option;
flush privileges;

The password can be different remote and local access time.

5) Configure the firewall

Firewall port 3306 is not turned on by default, to remote access, you need to open this port

Open the / etc / sysconfig / iptables

In the "-A INPUT -m state --state NEW -m tcp -p -dport 22 -j ACCEPT", added with:

-A INPUT -m state --state NEW -m tcp -p -dport 3306 -j ACCEPT

Then save and close the file, run the following command in the terminal, refresh the firewall configuration:

service iptables restart

All configuration is complete, you can access the MySQL.

Then add:

CentOS 7 default firewall using Firewalld do so modified iptables, after reboot the system simply does not work.

Firewalld add the port as follows:

firewall-cmd --zone = public --add-port = 3306 / tcp --permanent

firewall-cmd --reload
- MongoDB uses aggregate, group, match mysql achieve in having (count (1)> 1) features (Database)
- Linux dd command make U disk boot disk (Linux)
- CentOS NAT iptables (Linux)
- How to install the Linux text editor Atom 0.124.0 (Linux)
- Ubuntu Tutorial: E: Failed to get lock / var / lib / apt / lists / lock - open (Linux)
- How do I upgrade to Ubuntu 15.04 (Beta) (Linux)
- Use FFmpeg processing high quality GIF (Programming)
- Sublime Text 3 (Linux)
- Mutt - an email client that sends messages through the terminal (Linux)
- When Linux virtual machine to another copy of the operating system, a static IP NAT mode Invalid (Linux)
- Nginx request processing (Server)
- Use $ BASH ENV variable to mention the right way under Linux (Linux)
- How to manage your to-do list with the Go For It on Ubuntu (Linux)
- Some safety precautions of Linux servers (Linux)
- How comprehensive resist attacks from the network (Linux)
- Java development environment to build under Ubuntu (Linux)
- Shell Scripting Basics (Linux)
- Jump table (skiplist) of code (Programming)
- OpenGL Superb Learning Notes - Vertex Shader example (Programming)
- Installation CD audio file extraction tool Flacon (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.