Table of Contents
? ? 安装
Home Database Mysql Tutorial Centos上用YUM方式安装mysql衍生发行版Percona Server

Centos上用YUM方式安装mysql衍生发行版Percona Server

Jun 07, 2016 pm 04:34 PM
centos mysql yum Install Way

? ?? 前言 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 of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1671
14
PHP Tutorial
1276
29
C# Tutorial
1256
24
MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

Explain the purpose of foreign keys in MySQL. Explain the purpose of foreign keys in MySQL. Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

What currency does Ripple (XRP currency) belong to? Detailed tutorial for beginners What currency does Ripple (XRP currency) belong to? Detailed tutorial for beginners Apr 28, 2025 pm 07:57 PM

Created by Ripple, Ripple is used for cross-border payments, which are fast and low-cost and suitable for small transaction payments. After registering a wallet and exchange, purchase and storage can be made.

Compare and contrast MySQL and MariaDB. Compare and contrast MySQL and MariaDB. Apr 26, 2025 am 12:08 AM

The main difference between MySQL and MariaDB is performance, functionality and license: 1. MySQL is developed by Oracle, and MariaDB is its fork. 2. MariaDB may perform better in high load environments. 3.MariaDB provides more storage engines and functions. 4.MySQL adopts a dual license, and MariaDB is completely open source. The existing infrastructure, performance requirements, functional requirements and license costs should be taken into account when choosing.

CentOS: What Led to the Decision to End Support CentOS: What Led to the Decision to End Support Apr 23, 2025 am 12:10 AM

RedHatendedsupportforCentOStoshifttowardsacommerciallyfocusedmodelwithCentOSStream.1)CentOStransitionedtoCentOSStreamforRHELdevelopment.2)ThisencourageduserstomovetoRHEL.3)AlternativeslikeAlmaLinux,RockyLinux,andOracleLinuxemergedasreplacements.

SQL vs. MySQL: Clarifying the Relationship Between the Two SQL vs. MySQL: Clarifying the Relationship Between the Two Apr 24, 2025 am 12:02 AM

SQL is a standard language for managing relational databases, while MySQL is a database management system that uses SQL. SQL defines ways to interact with a database, including CRUD operations, while MySQL implements the SQL standard and provides additional features such as stored procedures and triggers.

MySQL: The Database, phpMyAdmin: The Management Interface MySQL: The Database, phpMyAdmin: The Management Interface Apr 29, 2025 am 12:44 AM

MySQL and phpMyAdmin can be effectively managed through the following steps: 1. Create and delete database: Just click in phpMyAdmin to complete. 2. Manage tables: You can create tables, modify structures, and add indexes. 3. Data operation: Supports inserting, updating, deleting data and executing SQL queries. 4. Import and export data: Supports SQL, CSV, XML and other formats. 5. Optimization and monitoring: Use the OPTIMIZETABLE command to optimize tables and use query analyzers and monitoring tools to solve performance problems.

How to safely store JavaScript objects containing functions and regular expressions to a database and restore? How to safely store JavaScript objects containing functions and regular expressions to a database and restore? Apr 19, 2025 pm 11:09 PM

Safely handle functions and regular expressions in JSON In front-end development, JavaScript is often required...

See all articles