Linux under Compilation install MySQL (Percona Server) 5.6

Source: Internet
Author: User
Tags mysql version readline install perl percona percona server

System environment:

    • CentOS 6.5/7.0 x86_64

    • Fedora x86_64

Brief introduction

Percona server is a derived version of MySQL, focusing on improvements to MySQL database server under Linux/bsd, with a significant improvement in functionality and performance compared to MySQL.

The compilation, configuration, and use of Percona Server is exactly the same as MySQL, and you can use it as MySQL.

Download Percona Server Source Package
# wget or MySQL source Bundle # wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.19.tar.gz
Installation dependencies
# yum Install gcc-c++ make CMake bison bison-devel ncurses-devel libaio-devel perl

for Fedora 20 and CentOS 7 you need to install an additional perl-Data-Dumper Package:

# yum Install Perl-data-dumper
Create a MySQL user
# groupadd mysql# useradd-g mysql-s/sbin/nologin-m MySQL
Create log directory and SOCK directory and Change permissions
# mkdir/var/log/mysql56# Chown-r mysql:mysql/var/log/mysql56/
Compiling the installation
# tar zxf percona-server-5.6.17-66.0.tar.gz -c /usr/local/src/# cd /usr/ local/src/percona-server-5.6.17-66.0/# cmake \-dcmake_install_prefix=/usr/local/mysql56 \- dsysconfdir=/usr/local/mysql56/etc \-dmysql_datadir=/var/lib/mysql56 \-dmysql_unix_addr=/var/run/ Mysql56/mysqld.sock \-dmysql_user=mysql \-dmysql_tcp_port=3306 \-dwith_myisam_storage_engine=1  \-dwith_innobase_storage_engine=1 \-dwith_memory_storage_engine=1 \-dwith_partition_storage_ Engine=1 \-dextra_charsets=all \-ddefault_charset=utf8 \-ddefault_collation=utf8_general_ci  \-denabled_local_infile=1 \-dwith_readline=1 

DENABLED_LOCAL_INFILE: Allows importing files to the database to speed up data import, using SQL statements:

LOAD data LOCAL INFILE data file into table name

WITH_READLINE: BindingReadLineterminal shortcut keys and history functions. But after installation is not still unable to find the feeling of readline, becauseDwith_readline was removed in MySQL version 5.6.5, the sameDwith_libedit in MySQL 5.6.12 version was also removed

if the compilation fails, clean the source directory CMakeCache.txt file, recompile.

# make-j8# make Install
Initializing the database

Switch to the MySQL installation directory :

# cd/usr/local/mysql56/

Created as a mysql user /var/lib/mysql56 DataDir directory, and write initialization database information:

# ./scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql56 

Copy the service file to /etc/init.d/mysql56 , mysql56 This file name is also the service name, can be arbitrarily changed, in order to unify we use MYSQL56 as the file name:

# CP Support-files/mysql.server/etc/init.d/mysql56
Configure MY.CNF
# vi/usr/local/mysql56/etc/my.cnf[mysqld]datadir=/var/lib/mysql56socket=/var/run/mysql56/ mysqld.sockskip-name-resolvesymbolic-links=0[mysqld_safe]log-error=/var/log/mysql56/mysqld-err.log#pid-file=/ Var/lib/mysql56/aboutc.pid

Note the file path.

Start the MySQL service
# service Mysql56 startstarting MySQL (Percona Server): success!

Change the root user password

#./bin/mysqladmin-u root password ' new-password '

Delete data with blank login user password

# ./bin/mysql -uroot -penter password:mysql> delete from mysql.user  where password =  "; query ok, 5 rows affected  (0.51 sec) Mysql> select user,host, password from mysql.user;+------+-----------+-------------------------------------------+| user  | host      | password                                    |+------+-----------+----------------------------------- --------+| root | localhost | *9f6f2xxxx40b6df5d2a5f762e1cf33782ca1abxx |+------ +-----------+-------------------------------------------+1 row in set  (0.01 sec) to this  mysql (percona server)   Compile installation complete, you can also choose to use  YUM  install  percona server,  about different memory sizes you can also choose the appropriate  my.cnf  profile to make your server resources balanced and provide better performance. FAQ If starting  MySQL  service appears: Starting mysql. error! the server quit without  updating PID file  error,  Check the  log-error  configured path and permissions in  my.cnf . If access to the database appears: Can ' t connect to local mysql server through socket  ' Xxx.sock '   Error,  please check  my.cnf   socket  configured path and permissions.


This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1839497

Linux under Compilation install MySQL (Percona Server) 5.6

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.