? ?? 前言 MySQL衍生版 Percona Server的更多資料請搜索~ 對于如今mysql在甲骨文的掌控下,最為開源軟件來說前景堪憂~ mysql的衍生版倒是有幾個,這些東西到底能不能用? 紅薯都用percona作為oschina的生產(chǎn)數(shù)據(jù)庫了。我也不怕了!哈哈,上!堅決的上!因為我
MySQL衍生版 Percona Server的更多資料請搜索~ 對于如今mysql在甲骨文的掌控下,最為開源軟件來說前景堪憂~ mysql的衍生版倒是有幾個,這些東西到底能不能用? 紅薯都用percona作為oschina的生產(chǎn)數(shù)據(jù)庫了。我也不怕了!哈哈,上!堅決的上!因為我是先拿vps小內存的環(huán)境開刀(搞熟悉了上生產(chǎn)線),所以centos6系統(tǒng)為32位滴,那么64位、centos5等等,如法炮制即可~
對?Percona Server?的擔憂,使用這個不會出問題吧,是不是和mysql都不一樣。不用擔心,mysql怎么用你他就怎么用,配置也是一樣的。
對于用源碼編譯安裝,和用rpm安裝的利弊,我這樣理解。如果你需要進行二次開發(fā)、修改、定制化,那么你就選擇源碼編譯安裝。如果你就是用用,那么直接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 ~]#
這樣已經(jīng)成功了,開始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
————-
[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!
到這里就已經(jīng)成功了。
啟動
/etc/init.d/mysql start
初始root密碼為空,執(zhí)行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官網(wǎng)在線生成percona(mysql) 配置文件my.cnf?https://tools.percona.com/?。強烈推薦,簡單、快捷、可靠。 percona通過yum安裝的rpm包默認沒有my.cnf文件在 /etc/my.cnf 。vi /etc/my.cnf 加入生成的配置即可。 數(shù)據(jù)庫默認路徑 /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官網(wǎng)生產(chǎn)的配置文件沒有指定字符集的,需要自己手動配置到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;
如果以上都做了,數(shù)據(jù)庫也設置為utf8了,但是還是會亂碼。
那么直接在SQL文件的最前面加上:
SET NAMES ‘utf8′;
它相當于下面的三句指令:
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;
和mysql完全一樣,停止和重啟也如法炮制
service mysql start
或者
/etc/init.d/mysql start
使用 Yum 安裝 Percona Server
Percona Server 啟用 HandlerSocket 插件
請問oschina現(xiàn)在用的是mysql還是Percona,什么存儲引擎?
Percona?yum?Repository?官網(wǎng)原文
building mysql 5.5.8 with default charset
Linux下MySQL 5.5的修改字符集編碼為UTF8(徹底解決中文亂碼問題)
原文地址:Centos上用YUM方式安裝mysql衍生發(fā)行版Percona Server, 感謝原作者分享。
聲明:本網(wǎng)頁內容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com