search
HomeDatabaseMysql TutorialCentos上用YUM方式安装mysql衍生发行版Percona Server

? ?? 前言 MySQL衍生版 Percona Server的更多资料请搜索~ 对于如今mysql在甲骨文的掌控下,最为开源软件来说前景堪忧~ mysql的衍生版倒是有几个,这些东西到底能不能用? 红薯都用percona作为oschina的生产数据库了。我也不怕了!哈哈,上!坚决的上!因为我

? ??前言

MySQL衍生版 Percona Server的更多资料请搜索~ 对于如今mysql在甲骨文的掌控下,最为开源软件来说前景堪忧~ mysql的衍生版倒是有几个,这些东西到底能不能用? 红薯都用percona作为oschina的生产数据库了。我也不怕了!哈哈,上!坚决的上!因为我是先拿vps小内存的环境开刀(搞熟悉了上生产线),所以centos6系统为32位滴,那么64位、centos5等等,如法炮制即可~

对?Percona Server?的担忧,使用这个不会出问题吧,是不是和mysql都不一样。不用担心,mysql怎么用你他就怎么用,配置也是一样的。

? ? 安装

对于用源码编译安装,和用rpm安装的利弊,我这样理解。如果你需要进行二次开发、修改、定制化,那么你就选择源码编译安装。如果你就是用用,那么直接yum吧骚年,难道你要rpm一个一个手动安装?ok那也行。

如果你是32位

[root@s1 ~]# rpm -Uhv?http://www.percona.com/redir/downloads/percona-release/percona-release-0.0-1.i386.rpm

如果你是64位

[root@s1 ~]# rpm -Uhv?http://www.percona.com/redir/downloads/percona-release/percona-release-0.0-1.x86_64.rpm

检查下

[root@s1 ~]# yum list |grep percona

percona-release.i386 0.0-1 installed

Percona-SQL-50-debuginfo.i686 5.0.92-b23.88.rhel6 percona

Percona-SQL-client-50.i686 5.0.92-b23.88.rhel6 percona

Percona-SQL-devel-50.i686 5.0.92-b23.88.rhel6 percona

Percona-SQL-server-50.i686 5.0.92-b23.88.rhel6 percona

Percona-SQL-shared-50.i686 5.0.92-b23.88.rhel6 percona

Percona-SQL-shared-compat.i686 5.0.92-b23.85.rhel6 percona

Percona-SQL-test-50.i686 5.0.92-b23.88.rhel6 percona

Percona-Server-51-debuginfo.i686 5.1.66-rel14.2.501.rhel6 percona

Percona-Server-55-debuginfo.i686 5.5.28-rel29.3.388.rhel6 percona

Percona-Server-client-51.i686 5.1.66-rel14.2.501.rhel6 percona

Percona-Server-client-55.i686 5.5.28-rel29.3.388.rhel6 percona

Percona-Server-devel-51.i686 5.1.66-rel14.2.501.rhel6 percona

Percona-Server-devel-55.i686 5.5.28-rel29.3.388.rhel6 percona

Percona-Server-server-51.i686 5.1.66-rel14.2.501.rhel6 percona

Percona-Server-server-55.i686 5.5.28-rel29.3.388.rhel6 percona

Percona-Server-shared-51.i686 5.1.66-rel14.2.501.rhel6 percona

Percona-Server-shared-55.i686 5.5.28-rel29.3.388.rhel6 percona

Percona-Server-shared-compat.i686 5.5.28-rel29.3.388.rhel6 percona

Percona-Server-test-51.i686 5.1.66-rel14.2.501.rhel6 percona

Percona-Server-test-55.i686 5.5.28-rel29.3.388.rhel6 percona

Percona-XtraDB-Cluster-client.i686 1:5.5.28-23.7.369.rhel6 percona

Percona-XtraDB-Cluster-debuginfo.i686 1:5.5.28-23.7.369.rhel6 percona

Percona-XtraDB-Cluster-devel.i686 1:5.5.28-23.7.369.rhel6 percona

Percona-XtraDB-Cluster-galera.i686 2.0-1.117.rhel6 percona

2.0-1.117.rhel6 percona

Percona-XtraDB-Cluster-server.i686 1:5.5.28-23.7.369.rhel6 percona

Percona-XtraDB-Cluster-shared.i686 1:5.5.28-23.7.369.rhel6 percona

Percona-XtraDB-Cluster-test.i686 1:5.5.28-23.7.369.rhel6 percona

percona-playback.i686 0.5-2.el6 percona

percona-playback-debuginfo.i686 0.5-2.el6 percona

percona-playback-devel.i686 0.5-2.el6 percona

percona-toolkit.noarch 2.1.8-1 percona

percona-xtrabackup.i686 2.0.4-484.rhel6 percona

percona-xtrabackup-debuginfo.i686 2.0.4-484.rhel6 percona

percona-xtrabackup-test.i686 2.0.4-484.rhel6 percona

[root@s1 ~]#

这样已经成功了,开始yum吧。里面有很多很多东东呢,还有备份工具什么的。还有不同的版本。选你需要的包。

这里一定要安装 Percona-Server-shared-compat 包,否则会报错的。

Running Transaction Test

Transaction Check Error:

file /usr/lib/libmysqlclient.so conflicts between attempted installs of Percona-Server-shared-51-5.1.66-rel14.2.501.rhel6.i686 and Percona-Server-shared-55-5.5.28-rel29.3.388.rhel6.i686

file /usr/lib/libmysqlclient_r.so conflicts between attempted installs of Percona-Server-shared-51-5.1.66-rel14.2.501.rhel6.i686 and Percona-Server-shared-55-5.5.28-rel29.3.388.rhel6.i686

Error Summary

————-

? ??yum需要的包

[root@s1 ~]#?yum install Percona-Server-shared-compat Percona-Server-client-55 Percona-Server-server-55 Percona-Server-shared-55 Percona-Server-test-55 ?percona-xtrabackup*

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 s1.us.iamle.com 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!

Percona recommends that all production deployments be protected with a support

contract (http://www.percona.com/mysql-suppport/) to ensure the highest uptime,

be eligible for hot fixes, and boost your team’s productivity.

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

Installing : Percona-Server-shared-compat-5.5.28-rel29.3.388.rhel6.i686 6/6

Verifying : Percona-Server-server-55-5.5.28-rel29.3.388.rhel6.i686 1/6

Verifying : Percona-Server-shared-compat-5.5.28-rel29.3.388.rhel6.i686 2/6

Verifying : percona-xtrabackup-test-2.0.4-484.rhel6.i686 3/6

Verifying : Percona-Server-shared-55-5.5.28-rel29.3.388.rhel6.i686 4/6

Verifying : percona-xtrabackup-2.0.4-484.rhel6.i686 5/6

Verifying : Percona-Server-client-55-5.5.28-rel29.3.388.rhel6.i686 6/6

Installed:

Percona-Server-client-55.i686 0:5.5.28-rel29.3.388.rhel6

Percona-Server-server-55.i686 0:5.5.28-rel29.3.388.rhel6

Percona-Server-shared-55.i686 0:5.5.28-rel29.3.388.rhel6

Percona-Server-shared-compat.i686 0:5.5.28-rel29.3.388.rhel6

percona-xtrabackup.i686 0:2.0.4-484.rhel6

percona-xtrabackup-test.i686 0:2.0.4-484.rhel6

Complete!

到这里就已经成功了。

启动

/etc/init.d/mysql start

初始root密码为空,执行mysql_secure_installation进行初始化root操作·

mysql_secure_installation

设置root密码

/usr/bin/mysqladmin -u root password ‘new-password’

或者

/usr/bin/mysqladmin -u root -h s1.us.iamle.com password ‘new-password’

设置msyql安全,去掉远程登录等。密码为刚刚设置的密码。

/usr/bin/mysql_secure_installation

? ??Percona(mysql)配置文件

? ? ?my.cnf

可以通过percona官网在线生成percona(mysql) 配置文件my.cnf?https://tools.percona.com/?。强烈推荐,简单、快捷、可靠。 percona通过yum安装的rpm包默认没有my.cnf文件在 /etc/my.cnf 。vi /etc/my.cnf 加入生成的配置即可。 数据库默认路径 /var/lib/mysql/ 。

ps:如果你在配置文件中改变了/var/lib/mysql/路径,请mv过去。搞错data目录是无法启动的。

会报错

[root@s1 mysql]# /etc/init.d/mysql start

Starting MySQL (Percona Server)… ERROR! The server quit without updating PID file (/home/mysql/data//s1.us.iamle.com.pid).

? ??默认字符集

二进制安装的percona默认的字符集为latin1 ,这里我们需要为utf8,percona官网生产的配置文件没有指定字符集的,需要自己手动配置到my.cnf文件中。

# CLIENT #
#修改客户端默认字符编码格式为utf8
default-character-set=utf8

# GENERAL #
#修改服务器端默认字符编码格式为utf8

character_set_server=utf8

#重启mysql后在查询中查看当前字符集~

show variables like ‘character%’;

show variables like ‘collation%’;

#查看所有字符集

show character set;

如果以上都做了,数据库也设置为utf8了,但是还是会乱码。

那么直接在SQL文件的最前面加上:
SET NAMES ‘utf8′;

它相当于下面的三句指令:
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;

? ??启动 percona(mysql)

和mysql完全一样,停止和重启也如法炮制

service mysql start

或者

/etc/init.d/mysql start

? ??扩展阅读

使用 Yum 安装 Percona Server

Percona Server 启用 HandlerSocket 插件

请问oschina现在用的是mysql还是Percona,什么存储引擎?

Percona?yum?Repository?官网原文

building mysql 5.5.8 with default charset

Linux下MySQL 5.5的修改字符集编码为UTF8(彻底解决中文乱码问题)

无觅相关文章插件,快速提升流量

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
When should you use a composite index versus multiple single-column indexes?When should you use a composite index versus multiple single-column indexes?Apr 11, 2025 am 12:06 AM

In database optimization, indexing strategies should be selected according to query requirements: 1. When the query involves multiple columns and the order of conditions is fixed, use composite indexes; 2. When the query involves multiple columns but the order of conditions is not fixed, use multiple single-column indexes. Composite indexes are suitable for optimizing multi-column queries, while single-column indexes are suitable for single-column queries.

How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)Apr 10, 2025 am 09:36 AM

To optimize MySQL slow query, slowquerylog and performance_schema need to be used: 1. Enable slowquerylog and set thresholds to record slow query; 2. Use performance_schema to analyze query execution details, find out performance bottlenecks and optimize.

MySQL and SQL: Essential Skills for DevelopersMySQL and SQL: Essential Skills for DevelopersApr 10, 2025 am 09:30 AM

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

Describe MySQL asynchronous master-slave replication process.Describe MySQL asynchronous master-slave replication process.Apr 10, 2025 am 09:30 AM

MySQL asynchronous master-slave replication enables data synchronization through binlog, improving read performance and high availability. 1) The master server record changes to binlog; 2) The slave server reads binlog through I/O threads; 3) The server SQL thread applies binlog to synchronize data.

MySQL: Simple Concepts for Easy LearningMySQL: Simple Concepts for Easy LearningApr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

MySQL: A User-Friendly Introduction to DatabasesMySQL: A User-Friendly Introduction to DatabasesApr 10, 2025 am 09:27 AM

The installation and basic operations of MySQL include: 1. Download and install MySQL, set the root user password; 2. Use SQL commands to create databases and tables, such as CREATEDATABASE and CREATETABLE; 3. Execute CRUD operations, use INSERT, SELECT, UPDATE, DELETE commands; 4. Create indexes and stored procedures to optimize performance and implement complex logic. With these steps, you can build and manage MySQL databases from scratch.

How does the InnoDB Buffer Pool work and why is it crucial for performance?How does the InnoDB Buffer Pool work and why is it crucial for performance?Apr 09, 2025 am 12:12 AM

InnoDBBufferPool improves the performance of MySQL databases by loading data and index pages into memory. 1) The data page is loaded into the BufferPool to reduce disk I/O. 2) Dirty pages are marked and refreshed to disk regularly. 3) LRU algorithm management data page elimination. 4) The read-out mechanism loads the possible data pages in advance.

MySQL: The Ease of Data Management for BeginnersMySQL: The Ease of Data Management for BeginnersApr 09, 2025 am 12:07 AM

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),