Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Through the source code to install MySQL 5.6.26 under CentOS6     - linux network security experience (Linux)

- Adding SSH to Github (Linux)

- Use smem visual display Linux memory usage (Linux)

- KUbuntu / Ubuntu 14.04 (downgrade) installed SVN 1.7 (Linux)

- Big Data Common Glossary (Linux)

- Linux platform Oracle MySQL connection (Database)

- Linux System Administrator Network Security Experience (Linux)

- Linux systems for entry-learning - Install Go language in Linux (Linux)

- The strings in Python reside (Programming)

- Cobbler automatic mass deployment of CentOS 6 and CentOS 7 (Linux)

- How to Install Foreman under Ubuntu (Server)

- Linux System Getting Started Learning: After starting in Ubuntu or Debian, enter the command line (Linux)

- Linux system security configuration (Linux)

- CentOS7 install JAVA notes (Linux)

- Yii PHP Framework Getting Started tutorial (Linux)

- Docker + OpenvSwitch build experimental environment VxLAN (Server)

- Deployment Kubernetes manage Docker example cluster on Ubuntu (Server)

- Linux, Google Test (GTest) test environment to build step (Linux)

- JDK comes with tools JPS (Linux)

- VMware virtual machine to install CentOS 6.2 (Linux)

 
         
  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:

https://downloads.mariadb.com/archives/mysql-5.6/mysql-5.6.26.tar.gz

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)

https://downloads.mariadb.com/archives/mysql-5.6

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 \
-DSYSCONFDIR = / Etc \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_PARTITION_STORAGE_ENGINE = 1 \
-DMYSQL_UNIX_ADDR = / Tmp / mysql.sock \
-DMYSQL_TCP_PORT = 3306 \
-DDEFAULT_CHARSET = Utf8 \
-DDEFAULT_COLLATION = Utf8_general_ci

make

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
     
         
       
         
  More:      
 
- Ubuntu system process is bound CPU core (Linux)
- Java data structures - the single linked list LinkedList linear table (Programming)
- Sublime Text - Opens the current file in a browser (Linux)
- How to use Android Studio to play more package names APK (Programming)
- Configure the Linux kernel and use iptables to do port mapping (Linux)
- Recover accidentally deleted Nginx logs (Server)
- Linux under HAProxy + Keepalived dual-availability program (Server)
- 24 Docker recommendations (Linux)
- MySQL 5.6 use GTIDs build the master database (Database)
- Spring AOP custom annotation way to achieve log management (Programming)
- Traffic monitor Linux Python Version (Programming)
- The practical application of Oracle synonyms + dblink (Database)
- Getting Started with Linux: CentOS7 Install Mono with the yum command (Server)
- Oracle LONG RAW BLOB CLOB type of presentation (Database)
- MySQL performance comparison of large amounts of data storage (Database)
- How to install the Linux text editor Atom 0.124.0 (Linux)
- Forgot Linux root password (Linux)
- Teach you self-built Linux firewall free (Linux)
- Oracle database online redo logs are several methods of recovery of deleted (Database)
- Why is the ibdata1 file growing in MySQL? (Database)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.