percona是mysql被收购后,研发团队核心成员独立成立的咨询公司开发的mysql另一个分支,继承了mysql开源特性以及最大限度的支持mysql,并且提供了许多新的特性,使得该软件成为行业内最为流行的其中一个版本之一,本文以整理了各种安装中最为简洁的rpm包的
安装方式,以起到抛砖引玉之功效:
安装环境:
安装思路步骤:
1.依次序安装三个文件
(先后顺序为shared/client/server,次序不能颠倒,否则不能正常安装)
2.配置参数文件
3.运行mysql服务
4.测试数据库是否正常
5.常见错误处理
以下为具体的安装步骤为(没有任何遗漏):
步骤一:安装三个文件
(当然需要上传三个文件,本例上传到/usr/local目录下)
有以下提示信息,暂不用理会,稍后处理
[root@localhost ~]# cd /usr/local
[root@localhost local]# ls
bin
etc
games
[root@localhost local]# ls
bin
etc
games
[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...
[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...
[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...
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:
Alternatively you can run:
which will also give you the option of removing the test
databases and anonymous user created by default.
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
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
bulgarian
charsets
czech
danish
dictionary.txt
dutch
[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%.
# 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.
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
~
~
~
~
~
~
~
~
~
~
~
~
"my-default.cnf" 31L, 1158C written
[root@localhost mysql]# ls
binary-configure
bulgarian
charsets
czech
danish
dictionary.txt
dutch
[root@localhost mysql]# cp my-default.cnf
[root@localhost mysql]# cp mysql.server
cp: overwrite `/etc/init.d/mysql'?
步骤三:查看服务端口是否起来,启动数据库
[root@localhost ~]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
[root@localhost ~]#
[root@localhost mysql]# service mysql start
Starting MySQL....[
[root@localhost mysql]#
[root@localhost ~]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
tcp
[root@localhost ~]#
步骤四:连接数据库测试
[root@localhost ~]# mysql -u root
Welcome to the MySQL monitor.
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>
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
+------------+------+
| liujianguo |
+------------+------+
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
========================================================================================