One : Uninstall old version

Use the following command to check if the MySQL Server

rpm -qa | grep mysql

If there is one, unload it with the following command

rpm -e mysql // Normal delete mode 
rpm -e --nodeps mysql // Strong delete mode , If you use the above command to delete , Prompt for other dependent files , It can be forcefully deleted with this command

Two : install MySQL

Install the packages required to compile code

yum -y install make gcc-c++ cmake bison-devel ncurses-devel

download MySQL 5.6.14

tar xvf mysql-5.6.14.tar.gz
cd mysql-5.6.14

Compilation and installation

cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DDEFAULT_COLLATION=utf8_general_ci make && make install

The compiled parameters can be referred to

The whole process needs 30 About minutes …… A long wait

3、 ... and : To configure MySQL

Set the permissions

Use the following command to see if there is mysql Users and user groups

cat /etc/passwd View the list of users 
cat /etc/group View the list of user groups

If not, create

groupadd mysql
useradd -g mysql mysql

modify /usr/local/mysql jurisdiction

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

modify /usr/local/mysql jurisdiction

Initialize configuration

Enter the installation path

cd /usr/local/mysql

Enter the installation path , Execute initialization configuration script , Create databases and tables that come with the system

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

notes : Start up MySQL The service , Will search in a certain order my.cnf, First in /etc Search under directory , If not, it will search "$basedir/my.cnf", In this case /usr/local/mysql/my.cnf, This is the new version MySQL The default location of the configuration file for !

Be careful : stay CentOS 6.4 After the minimum installation of version , stay /etc There will be a my.cnf, You need to change this file to another name , Such as :/etc/my.cnf.bak, otherwise , This file will interfere with the installation of the source code MySQL Correct configuration , Cause unable to start .

In the use of "yum update" After updating the system , Need to check /etc Will there be one more in the directory my.cnf, If more , Rename it something else . otherwise ,MySQL This configuration file will be used to start , It may cause problems such as unable to start normally .

start-up MySQL

Add service , Copy the service script to init.d Catalog , And set boot up

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

Configure users

MySQL After successful startup ,root No password by default , We need to set root password .

Set before , We need to set up PATH, Or you can't call mysql

modify /etc/profile file , Add at the end of the file

export PATH

Close file , Run the following command , Let configuration take effect immediately

source /etc/profile

Now? , We can input it directly in the terminal mysql Get into ,mysql The environment of

Execute the following command to modify root password

mysql -uroot
mysql> SET PASSWORD = PASSWORD('123456');

To set root Users can access... Remotely , perform

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.16.%' IDENTIFIED BY 'password' WITH GRANT OPTION;

Red password For remote access ,root User's password , It can be different from the local .

Reference article :

CentOS 6 Download and install MySQL 5.6 More articles about

  1. Centos 7 Download and install Mysql

    (1) Official website download address : Download here is mysql-boost-5.7..tar.gz Baidu cloud download address :https://pan. ...

  2. CentOS Download and install MySQL

    CnetOS Download and install MySql Check to see if there is an old version : rpm -qa | grep mysql Uninstall old version : rpm -e mysql   # Normal delete mode rpm -e --nodeps mys ...

  3. CentOS Source code compilation and installation MySQL 5.5.15

    CentOS Source code compilation and installation MySQL 5.5.15   List of articles [ hide ] Install the compiler Download the source code install cmake and bison Compilation and installation MySQL Some related settings Install the compiler yum install g ...

  4. CentOS Download and install MySQL 5.6.21

    One . Compilation and installation MySQL Preparations before Install the tools and libraries needed to compile the source code yum install gcc gcc-c++ ncurses-devel perl install cmake:http://www.cnblog ...

  5. Linux CentOS6.5 Download and install MySQL 5.6.16【 A detailed tutorial for awesome 】

    One . Compilation and installation MySQL Preparations before Install the tools and libraries needed to compile the source code yum install gcc gcc-c++ ncurses-devel perl install cmake, from http://www.cmake ...

  6. Linux Download and install MySQL

    One . Environmental preparation yum install -y ncurses-devel libaio-develyum install -y cmake makeuseradd -s /sbin/nologin -M ...

  7. Linux CentOS6.5 Download and install MySQL 5.6

    Check : Unload the original MySql because mysql The database is Linux It's so popular in the world , So the current mainstream of downloads Linux The system versions are basically integrated mysql The database is in there , We can use the following command to check whether our operating system has ...

  8. Linux(CentOS6.5) Download and install MySQL Community Server 5.7.12

      Components Official website Direct download address remarks mysql ...

  9. CentOS 6.4 Download and install MySQL 5.6.14

    summary : CentOS 6.4 Pass through yum Installed MySQL yes 5.1 Version of , Relatively old , So I want to install a higher version of 5.6.14. Text : One : Uninstall old version Use the following command to check if the MySQL Server ...

Random recommendation

  1. Git Branch ( Local )

    1.Git It's not the differences or changes in the files that are saved , It's just a series of file snapshots (File Snapshot):   2. The staging operation computes a checksum for each file (SHA-1 Hash string ), Then save the current version of the file snapshot to Git warehouse ...

  2. EclEmma Introduction to 、 Installation and use

    p{line-height: 200%}   1. EclEmma Introduction to   EclEmma Is an open source software testing tool , You can check the code calls during the coding process . You can also detect single coverage .   2. Eclipse Next ...

  3. object-oriented -- Class library 、 entrust 、is and as Operator 、 Generic set

    Class library : It's just a bunch of class files , Just can't see the source code of these classes , Confidentiality is good. . advantage : Confidentiality is good. shortcoming : If it doesn't work , Users can't change it themselves . Most of them are dll file . Usage method : Right click reference , Add reference , Browse , Select to phase ...

  4. DELL The notebook is disassembled to add a memory module

    Twist it on the back of the notebook 7 Two screws Then open the back cover Break the bayonet , The memory module will pop up , At this time, press and hold the gap on both sides of the memory module, and pull it out . When loading a memory module , Insert the memory module first , Press to .

  5. psp Personal software process requirements document

    1.   Business needs 1.1  Application background Development software project schedule is always so inaccurate , Delays happen all the time , What's hateful is that we can't even give a relatively clear delay time . It's big The factor is that the completion time allocated to developers is different from the actual completion time of developers ...

  6. js Traversing the collection, deleting elements

    js Traversing the collection, deleting elements /** * Effective way - Change the subscript , Control traversal */ for (var i = 0; i < arr.length; i++) { if (...) { arr.spli ...

  7. Work experience - Type conversion [ java.lang.String]

    Error code :"1"); Map<String,String> zxmap = (Map) zxList.get(0); ybty.setFyze ...

  8. jQuery Double-click the event (dblclick)

    stay jQuery In the event binding of , Execute the double click event (dblclick) Can trigger two click events (click). It's a label element ( Such as div etc. ), If the element is also bound with a click event (click) And double click events (dblclick), that ...

  9. python Lesson 29 —— File read and write ( The operation of writing data )

    Demonstrate how to write data : Conclusion : Write data to a file , If the file doesn't exist , Create a file first , Then write the content #1. Open file fw=open(r'd.txt','w',encoding='utf-8') #2. Write data operations fw ...

  10. [LeetCode] 35. Search Insert Position *( Missing numbers )

    Reprint :    Ideas Given a sorted array ...