Mysql之Percona(1)最新版本5.6.10…

 

percona是mysql被收购后,研发团队核心成员独立成立的咨询公司开发的mysql另一个分支,继承了mysql开源特性以及最大限度的支持mysql,并且提供了许多新的特性,使得该软件成为行业内最为流行的其中一个版本之一,本文以整理了各种安装中最为简洁的rpm包的
安装方式,以起到抛砖引玉之功效:

安装环境:
          操作系统:本安装过程在虚拟机中linux5.4版本安装完成,
          数据库:  percona5.6.10

 

安装思路步骤:

1.依次序安装三个文件
(先后顺序为shared/client/server,次序不能颠倒,否则不能正常安装)
 rpm -ivh Percona-Server-shared-56-5.6.10-alpha60.2.324.rhel5.i686.rpm
 rpm -ivh Percona-Server-client-56-5.6.10-alpha60.2.324.rhel5.i686.rpm
 rpm -ivh Percona-Server-server-56-5.6.10-alpha60.2.324.rhel5.i686.rpm
2.配置参数文件

  cp my-default.cnf  /etc/my.cnf
  cp mysql.server  /etc/init.d/mysql(部分版本必须要拷贝,本版本经测试不需拷贝)
  编辑my-default.cnf 配置文件,将其拷贝到对应位置/etc/my.cnf
  在my-default.cnf 文件中[mysqld]之下需要加添的是:
  explicit_defaults_for_timestamp=true
  在步骤一中有提示需要条件该参数,否则,数据库无法正常启动,这是通常安装数据库最长遇到的问题
  其他的几个内存配置参数#去掉保持最小配置即可,保存退出即可
  innodb_buffer_pool_size = 128M
  join_buffer_size = 128M
  sort_buffer_size = 2M
  read_rnd_buffer_size = 2M  
 
 
3.运行mysql服务
  运行natstat -nat查看3306端口是否使用
  service mysql start

4.测试数据库是否正常
  mysql -u root

5.常见错误处理


以下为具体的安装步骤为(没有任何遗漏):

步骤一:安装三个文件
(当然需要上传三个文件,本例上传到/usr/local目录下)
有以下提示信息,暂不用理会,稍后处理
[root@localhost ~]# cd /usr/local
[root@localhost local]# ls
bin    include  Percona-Server-client-56-5.6.10-alpha60.2.324.rhel5.i686.rpm  sbin
etc    lib      Percona-Server-server-56-5.6.10-alpha60.2.324.rhel5.i686.rpm  share
games  libexec  Percona-Server-shared-56-5.6.10-alpha60.2.324.rhel5.i686.rpm  src
[root@localhost local]# ls
bin    include  Percona-Server-client-56-5.6.10-alpha60.2.324.rhel5.i686.rpm  sbin
etc    lib      Percona-Server-server-56-5.6.10-alpha60.2.324.rhel5.i686.rpm  share
games  libexec  Percona-Server-shared-56-5.6.10-alpha60.2.324.rhel5.i686.rpm  src
[root@localhost local]# rpm -ivh Percona-Server-shared-56-5.6.10-alpha60.2.324.rhel5.i686.rpm
warning: Percona-Server-shared-56-5.6.10-alpha60.2.324.rhel5.i686.rpm: Header V4 DSA signature: NOKEY, key ID cd2efd2a
Preparing...                ########################################### [100%]
   1:Percona-Server-shared-5########################################### [100%]
[root@localhost local]# rpm -ivh Percona-Server-client-56-5.6.10-alpha60.2.324.rhel5.i686.rpm
warning: Percona-Server-client-56-5.6.10-alpha60.2.324.rhel5.i686.rpm: Header V4 DSA signature: NOKEY, key ID cd2efd2a
Preparing...                ########################################### [100%]
   1:Percona-Server-client-5########################################### [100%]
[root@localhost local]# rpm -ivh Percona-Server-server-56-5.6.10-alpha60.2.324.rhel5.i686.rpm
warning: Percona-Server-server-56-5.6.10-alpha60.2.324.rhel5.i686.rpm: Header V4 DSA signature: NOKEY, key ID cd2efd2a
Preparing...                ########################################### [100%]
   1:Percona-Server-server-5########################################### [100%]
2013-05-30 13:11:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-05-30 13:11:06 14120 [Note] InnoDB: The InnoDB memory heap is disabled
2013-05-30 13:11:06 14120 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-05-30 13:11:06 14120 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-05-30 13:11:06 14120 [Note] InnoDB: CPU does not support crc32 instructions
2013-05-30 13:11:06 14120 [Note] InnoDB: Using Linux native AIO
2013-05-30 13:11:06 14120 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-05-30 13:11:06 14120 [Note] InnoDB: Completed initialization of buffer pool
2013-05-30 13:11:06 14120 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-05-30 13:11:06 14120 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-05-30 13:11:06 14120 [Note] InnoDB: Database physically writes the file full: wait...
2013-05-30 13:11:07 14120 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-05-30 13:11:08 14120 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-05-30 13:11:09 14120 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-05-30 13:11:09 14120 [Warning] InnoDB: New log files created, LSN=45781
2013-05-30 13:11:09 14120 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-05-30 13:11:10 14120 [Note] InnoDB: Doublewrite buffer created
2013-05-30 13:11:10 14120 [Note] InnoDB: 128 rollback segment(s) are active.
2013-05-30 13:11:10 14120 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-05-30 13:11:10 14120 [Note] InnoDB: Foreign key constraint system tables created
2013-05-30 13:11:10 14120 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-05-30 13:11:10 14120 [Note] InnoDB: Tablespace and datafile system tables created.
2013-05-30 13:11:10 14120 [Note] InnoDB: Waiting for purge to start
2013-05-30 13:11:10 14120 [Note] InnoDB: 1.2.10 started; log sequence number 0
2013-05-30 13:11:11 14120 [Note] Binlog end
2013-05-30 13:11:11 14120 [Note] InnoDB: FTS optimize thread exiting.
2013-05-30 13:11:11 14120 [Note] InnoDB: Starting shutdown...
2013-05-30 13:11:12 14120 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2013-05-30 13:11:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-05-30 13:11:12 14143 [Note] InnoDB: The InnoDB memory heap is disabled
2013-05-30 13:11:12 14143 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-05-30 13:11:12 14143 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-05-30 13:11:12 14143 [Note] InnoDB: CPU does not support crc32 instructions
2013-05-30 13:11:12 14143 [Note] InnoDB: Using Linux native AIO
2013-05-30 13:11:12 14143 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-05-30 13:11:12 14143 [Note] InnoDB: Completed initialization of buffer pool
2013-05-30 13:11:12 14143 [Note] InnoDB: Highest supported file format is Barracuda.
2013-05-30 13:11:13 14143 [Note] InnoDB: 128 rollback segment(s) are active.
2013-05-30 13:11:13 14143 [Note] InnoDB: Waiting for purge to start
2013-05-30 13:11:13 14143 [Note] InnoDB: 1.2.10 started; log sequence number 1625977
2013-05-30 13:11:13 14143 [Note] Binlog end
2013-05-30 13:11:13 14143 [Note] InnoDB: FTS optimize thread exiting.
2013-05-30 13:11:13 14143 [Note] InnoDB: Starting shutdown...
2013-05-30 13:11:15 14143 [Note] InnoDB: Shutdown completed; log sequence number 1625987

 


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/bin/mysqladmin -u root password 'new-password'
  /usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

Percona Server is distributed with several useful UDF (User Defined Function) from Maatkit.
Run the following commands to create these functions:
mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"
mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"
See http://code.google.com/p/maatkit/source/browse/trunk/udf for more details
[root@localhost local]#

步骤二:配置参数文件
[root@localhost ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
[root@localhost ~]# cd /usr/share/mysql/
[root@localhost mysql]# ls
binary-configure  english               hungarian                    mysqld_multi.server           norwegian     serbian
bulgarian         errmsg-utf8.txt       innodb_memcached_config.sql  mysql-log-rotate              norwegian-ny  slovak
charsets          estonian              italian                      mysql_security_commands.sql   polish        solaris
czech             fill_help_tables.sql  japanese                     mysql.server                  portuguese    spanish
danish            french                korean                       mysql_system_tables_data.sql  romanian      swedish
dictionary.txt    german                magic                        mysql_system_tables.sql       russian       ukrainian
dutch             greek                 my-default.cnf               mysql_test_data_timezone.sql  SELinux
[root@localhost mysql]# vi my-default.cnf

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]
explicit_defaults_for_timestamp=true
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
 innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
 join_buffer_size = 128M
 sort_buffer_size = 2M
 read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
~
~
~
~
~
~
~
~
~
~
~
~
"my-default.cnf" 31L, 1158C written
[root@localhost mysql]# ls
binary-configure  english               hungarian                    mysqld_multi.server           norwegian     serbian
bulgarian         errmsg-utf8.txt       innodb_memcached_config.sql  mysql-log-rotate              norwegian-ny  slovak
charsets          estonian              italian                      mysql_security_commands.sql   polish        solaris
czech             fill_help_tables.sql  japanese                     mysql.server                  portuguese    spanish
danish            french                korean                       mysql_system_tables_data.sql  romanian      swedish
dictionary.txt    german                magic                        mysql_system_tables.sql       russian       ukrainian
dutch             greek                 my-default.cnf               mysql_test_data_timezone.sql  SELinux
[root@localhost mysql]# cp my-default.cnf  /etc/my.cnf
[root@localhost mysql]# cp mysql.server  /etc/init.d/mysql
cp: overwrite `/etc/init.d/mysql'?

步骤三:查看服务端口是否起来,启动数据库
[root@localhost ~]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State     
tcp            0 127.0.0.1:2208              0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:868                 0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:11111               0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:111                 0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:16851               0.0.0.0:*                   LISTEN     
tcp            0 192.168.122.1:53            0.0.0.0:*                   LISTEN     
tcp            0 127.0.0.1:631               0.0.0.0:*                   LISTEN     
tcp            0 127.0.0.1:25                0.0.0.0:*                   LISTEN     
tcp            0 127.0.0.1:2207              0.0.0.0:*                   LISTEN     
tcp            0 :::22                       :::*                        LISTEN     
tcp            0 ::ffff:192.168.66.111:22    ::ffff:192.168.66.101:1953  ESTABLISHED
tcp            0 ::ffff:192.168.66.111:22    ::ffff:192.168.66.101:1973  ESTABLISHED
[root@localhost ~]#

[root@localhost mysql]# service mysql start
Starting MySQL....[  OK  ]
[root@localhost mysql]#
[root@localhost ~]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State     
tcp            0 127.0.0.1:2208              0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:868                 0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:11111               0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:111                 0.0.0.0:*                   LISTEN     
tcp            0 0.0.0.0:16851               0.0.0.0:*                   LISTEN     
tcp            0 192.168.122.1:53            0.0.0.0:*                   LISTEN     
tcp            0 127.0.0.1:631               0.0.0.0:*                   LISTEN     
tcp            0 127.0.0.1:25                0.0.0.0:*                   LISTEN     
tcp            0 127.0.0.1:2207              0.0.0.0:*                   LISTEN     
tcp            0 :::3306                     :::*                        LISTEN     
tcp            0 :::22                       :::*                        LISTEN     
tcp            0 ::ffff:192.168.66.111:22    ::ffff:192.168.66.101:1953  ESTABLISHED
tcp            0 ::ffff:192.168.66.111:22    ::ffff:192.168.66.101:1973  ESTABLISHED
[root@localhost ~]#

步骤四:连接数据库测试
[root@localhost ~]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.10-56 Percona Server (GPL), Release alpha60.2, Revision 324

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>  create table ljg (name varchar(10),old numeric(8));
Query OK, 0 rows affected (0.06 sec)

mysql> insert into ljg values('liujianguo',35);
Query OK, 1 row affected (0.01 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from ljg;
+------------+------+
| name       | old  |
+------------+------+
| liujianguo |   35 |
+------------+------+
1 row in set (0.00 sec)

mysql>

以上为percona最新版本5.6.10基本的安装过程,给第一次接触percona的同学提供一个完全的一步不漏的最新版本的安装过程,供学习参考。

 

5.常见错误处理

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

提示要在配置文件中添加explicit_defaults_for_timestamp=true即可。
具体是:
vi /etc/my.cnf
中的[mysqld]下添加explicit_defaults_for_timestamp=true即可

 

========================================================================================

==本博所有内容均由数据库男本人实际工作环境或模拟操作过程,如有编辑错误或其他问题请和本==

==人留言或联系。发扬互联网精神,一起学习,共同努力,完成由专注到卓越的飞跃。?!?    ==

==QQ:77113981                                                !!  =============    ==

========================================================================================


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值