This article comes from my github pages Blog namely

1、 download : At present mysql Here's the version 5.6.28

choice Source Code


2、 Necessary software package

yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake

3、 Compilation and installation

Add users

groupadd mysql
useradd -r -g mysql mysql

Compilation and installation

tar -zxvf mysql-5.6..tar.gz
cd mysql-5.6.

By default, it is installed in /usr/local/mysql

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

The compiled parameters can be referred to

Change directory owner

chown -R mysql.mysql /usr/local/mysql

4、 Initialize database

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

5、 Register as a service

cd /usr/local/mysql/support-files
# Registration service 
cp mysql.server /etc/rc.d/init.d/mysql # Use the default profile
cp my-default.cnf /etc/my.cnf # Give Way chkconfig management mysql service
chkconfig --add mysql # Boot up
chkconfig mysql on

6、 start-up MySQL service

service mysql start

7、 Change coding , Prevent confusion code

modify mysql Of my.cnf file
default-character-set=utf8 [mysqld]
character-set-server=utf8 [mysql]

8、 take mysql Of bin Add to path in

cd ~
# I put path Added to the current user directory bashrc in , If you need global settings , Please amend `/etc/profile`
vi .bashrc # Add the following
export PATH

9、 Configure user passwords and remote access rights

mysql -uroot

CENTOS6.6 Next mysql5.6 Source code installation of more related articles

  1. RHEL Server 6.3 Next MySQL5.5.25a Source code installation

    OS:RHEL Server 6.3 MySQL:mysql-5.5.25a.tar.gz Dependent package : ncurses-5.9.tar.gz bison-2.5.tar.gz install MySQL One . Ann ...

  2. CentOs Next MySQL5.6.32 Source code installation

    . Install well -- install MySQL Need to pack yum install -y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c+ ...

  3. CentOS 6.3 64 Place below MySQL5.1.54 Source installation configuration details

    Installation environment :CentOS 6.3 64 position One : Install dependency package first ( Otherwise, an error will be reported during configuration !) yum -y install ncurses* libtermcap* newly build mysql user [[email protected] ...

  4. linux Next MySQL 5.6 Source code installation

    linux Next MySQL 5.6 Source code installation 1. download : At present mysql Here's the version 5.6.20 choice Source Code 2. Necessary software ...

  5. mysql-5.5.28 Source code installation process error summary

    Tell me something about mysql-5.5.28 Summary of several major errors in the process of source code installation , I hope this article can help you . System centOS 6.3 mini ( There is no compilation environment ) The precompile environment first installed the well-known cmake(yum ...

  6. mysql-5.7.25 Source code install

    mysql-5.7.25 Source code install compile export INSTALL_PREFIX="/data/services" export MYSQL_INSTALL_PATH=&qu ...

  7. MySQL5.7.20 Source code installation and pt-query-digest Usage examples

    MySQL5.7.20 Source code installation 1. Download decompression cd /data/app/mysql5.7wget ...

  8. mysql5.5.30 Source code installation and master-slave build

    hot standby ( Experimental environment ) master server :ip Address,mysql edition 5.5.30, Source code installation From the server :ip Address One . Source code installation mysql5.5 Start Directory : ...

  9. mysql5.7.17 Source code installation

    Create users and directories groupadd mysql useradd -r -g mysql mysql mkdir -p /data/mysql/standby/data mkdir -p /data/my ...

Random recommendation

  1. JS Constant in ( Basic data type ) And built-in objects

    JS Basic data types in : String .number.null.boolean.undefined.object.symbol(ES6) 1.  utilize typeof Operator, where only null Is abnormal ,ty ...

  2. CSS3 You have to know 10 A top-level command

    1. Border fillet (Border Radiuas) This is what we usually use , I used to use it div When rounding , Special pain , No matter how it is used CSS To draw fillet. , It's not so easy to draw round corners with pictures , But now it's all right , stay CSS3 in ...

  3. python Basics —— modular

    python Basics —— modular In the development of computer programs , As the program code gets more and more written , The code will get longer and longer in a file , It's getting harder and harder to maintain . To write maintainable code , We group a lot of functions , Put them in separate files , such , Every article ...

  4. cocos2d-x Of Android Project start c++0x characteristic

    First of all, make sure you install NDK Support c++0x( I installed android-ndk-r8) Text open Project directory / stay APP_CPPFLAGS That line ...

  5. [C/C++]C/C++ Related websites

    1. What is the purpose of this site? Our goal is to provide programmers wi ...

  6. selenium-grid2 Remote concurrency control use case execution

    I have nothing to do today , Take a casual look selenium, Suddenly notice grid This function used to be , I'm reading about selenium I knew there was such a grid The function of remote control , But never tried . So , Today, I simply made such a small ...

  7. C# Five tier architecture

    UI Business Logic Layer Business Rule Layer Data Access Layer Data Definition Layer Simple factory model simple fa ...

  8. CodeBlocks Download and install 、 To configure 、 Simple programming

    CodeBlocks Download and install . To configure . Simple programming IDE brief introduction , This is just an introduction to Windows Under the platform IDE Environment configuration . CodeBl ...

  9. Put the html Code table Save as word file

    1. Background code : string nowtime = DateTime.Now.ToString("yyyy-MM-dd"); Response.Clear(); Response.B ...

  10. python--------- Function exercises

    2. Write function ,, The user passes in the modified file name , And the content to be modified , Execute function , Complete the batch modification of the whole file # Method 1 # import os # def fun(): #y For the content to be modified ,z As a result of the modification # y=in ...