2013年5月6日星期一

從來源的MySQL :: MariaDB的:: Percona的建築

Original Post: http://anothermysqldba.blogspot.com/2013/05/building-from-source-mysql-mariadb.html

這是可能的,在同一服務器上運行一個以上的MySQL服務器。 有時人們可能會想安裝其他版本的數據庫在同一硬件上測試的目的,以及評估。

安裝源和自定義安裝為每個數據庫比聽起來更容易一些。 我會建議檢討MySQL的沙盒,雖然第一次,因為它允許做得非常快速,方便地評估和測試。 然而,從源代碼安裝工作更好地為我的時候,我做了一些比較。 下面是我使用的過程。 我會希望打造出了未來的博客文章,有一次我與這些數據庫調整,然後配置。



這是默認信息mysql.com 。 我已經安裝了MySQL,所以我沒有執行下面的,但我想在這裡僅供參考。 您可以比較這些步驟到MySQL,MariaDB的和Percona的源代碼安裝的,下面也看到我是如何更新的默認步驟,以獲得所有三個版本的同一台機器上運行的數據庫。 (這裡沒有生產價值做只是為了測試的過程。)

# Preconfiguration setup
shell> groupadd mysql
shell> useradd -r -g mysql mysql

# Beginning of source-build specific instructions
shell> tar zxvf mysql-VERSION.tar.gz
shell> cd mysql-VERSION
shell> cmake .
shell> make
shell> make install
# End of source-build specific instructions

# Postinstallation setup
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data

# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &

# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server


If you prefer to use the mysql.server腳本啟動和停止,確保相應的審查和編輯。
# Preconfiguration setup
shell> groupadd oracle_mysql
shell> useradd -r -g
 # Preconfiguration setup
shell> groupadd oracle_mysql
shell> useradd -r -g
 oracle_mysql oracle_mysql oracle_mysql 
# Beginning of source-build specific instructions
shell> tar zxvf MariaDB -VERSION .tar.gz
shell> cd MySQL-VERSION
shell> cmake .
shell> make
shell> make install DESTDIR=" /usr/local/
 # Beginning of source-build specific instructions
shell> tar zxvf MariaDB -VERSION .tar.gz
shell> cd MySQL-VERSION
shell> cmake .
shell> make
shell> make install DESTDIR=" /usr/local/
 oracle_mysql的TMP“
# End of source-build specific instructions

I do not like the results
-- Installing: /usr/local/ oracle_mysql的TMP的/ usr / local / mysql下/
If DESTDIR is should install into that location not start with user under that location. This is a MySQL original issue as it does this with all versions of MySQL.

# Fix the odd/bug setup
shell> cd /usr/local/
 If DESTDIR is should install into that location not start with user under that location. This is a MySQL original issue as it does this with all versions of MySQL.

# Fix the odd/bug setup
shell> cd /usr/local/
 oracle_mysql的TMP
shell> mv usr/local/mysql/ ../ oracle_mysql ;
shell> cd ../; # rm -Rf oracle_mysql shell> cd ../; # rm -Rf -TMP

# Postinstallation setup
shell> cd /usr/local/ oracle_mysql的 
shell> chown -R
 
shell> chown -R
 oracle_mysql .
shell> chgrp -R oracle_mysql .

# Next command is optional
shell> cp support-files/my-small.cnf /etc/
 # Next command is optional
shell> cp support-files/my-small.cnf /etc/
 oracle_mysql的.cnf
shell> vi /etc/ .cnf shell> vi /etc/ oracle_mysql的.cnf

port = 3309

socket = /tmp/ oracle_mysql .sock


shell> scripts/mysql_install_db --defaults-file=/etc/oracle_mysql.cnf --basedir=/usr/local/oracle_mysql --skip-name-resolve --datadir=/var/lib/oracle_mysql --user=oracle_mysql
shell> chown -R oracle_mysql /var/lib/oracle_mysql /*

shell> # bin/mysqld_safe --defaults-file=/etc/ oracle_mysql .cnf --user= oracle_mysql --datadir=/var/lib/ oracle_mysql / --port=3309 &


shell> # bin/ mysql --port=3309 --socket=/tmp/ oracle_mysql .sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.31 Source distribution

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








# Preconfiguration setup
shell> groupadd mariadb
shell> useradd -r -g mariadb mariadb

# Beginning of source-build specific instructions
shell> tar zxvf MariaDB -VERSION .tar.gz
shell> cd MariaDB-VERSION
shell> cmake .
shell> make
shell> make install DESTDIR=" /usr/local/ mariadb -tmp "
# End of source-build specific instructions

I do not like the results
-- Installing: /usr/local/ mariadb-tmp /usr/local/mysql/
If DESTDIR is should install into that location not start with user under that location. This is a MySQL original issue as it does this with all versions of MySQL.

# Fix the odd/bug setup
shell> cd /usr/local/ mariadb -tmp
shell> mv usr/local/mysql/ ../ mariadb ;
shell> cd ../; # rm -Rf mariadb -tmp

# Postinstallation setup
shell> cd /usr/local/mariadb
shell> chown -R mariadb .
shell> chgrp -R mariadb .


#下的命令是可選的 
外殼> CP support-files/my-small.cnf的/ etc / CNF MariaDB的。

CNF殼> VI的/ etc / MariaDB的。

端口= 3308

插座= / tmp目錄/ MariaDB的襪子


shell> scripts/mysql_install_db --defaults-file=/etc/mariadb.cnf --basedir=/usr/local/ mariadb --skip-name-resolve --datadir=/var/lib/mariadb --user= mariadb
shell> chown -R mariadb /var/lib/ mariadb /*

shell> # bin/mysqld_safe --defaults-file=/etc/ mariadb .cnf --user= mariadb --datadir=/var/lib/mariadb / --port=3308 &


shell> # bin/ mysql --port=3308 --socket=/tmp/ mariadb .sock
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.30-MariaDB Source distribution

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.






# Preconfiguration setup
shell> groupadd percona
shell> useradd -r -g percona percona

# Beginning of source-build specific instructions
shell> tar zxvf Percona-Server -VERSION .tar.gz
shell> cd Percona-Server-VERSION
shell> cmake .
shell> make
shell> make install DESTDIR=" /usr/local/percona-tmp "
# End of source-build specific instructions

I do not like the results

-- Installing: /usr/local/percona-tmp/usr/local/mysql/

If DESTDIR is should install into that location not start with user under that location. This is a MySQL original issue as it does this with all versions of MySQL.

# Fix the odd/bug setup
shell> cd /usr/local/percona-tmp

shell> mv usr/local/mysql/ ../percona ;

shell> cd ../; # rm -Rf percona-tmp




# Next command is optional
shell> cp support-files/my-small.cnf /etc/ percona .cnf

shell> vi /etc/ percona .cnf

port = 3307

socket = /tmp/percona.sock




#安裝後的設置
外殼> CD的/ usr /本地/ Percona的 
殼>喬敦-R Percona的。
外殼> chgrp命令ŗ的Percona的。

外殼腳本/ mysql_install_db的 -默認文件為/ etc / percona.cnf - BASEDIR = / USR /本地/ Percona的-跳過名稱決心的- DATADIR =的/ var / lib中/ Percona的-用戶= Percona的
外殼>喬敦-R Percona的的/ var / lib / Percona的中/ *
外殼>#斌/ mysqld_safe的-默認文件為/ etc / percona.cnf -用戶= Percona的- DATADIR =的/ var / lib / Percona的中/ -端口= 3307  



外殼>#斌/ MySQL的-端口= 3307 -插座= / TMP / percona.sock中
歡迎到MySQL監視器。 命令結束或\ G。
你的MySQL連接ID為1
服務器版本:30年5月5日來源分佈

版權所有(c)2000年,2013年,甲骨文公司及/或其附屬公司。 保留所有權利。




現在我有機會向所有3種口味或MySQL。
為了方便客戶端訪問,我加入這個我bashrc文件:

  • 別名Percona的='/ USR /本地/ Percona的/ bin中/ MySQL的 - 端口= 3307 - 插座= / tmp / percona.sock中'
  • 別名oracle_mysql ='/ USR /當地/ oracle_mysql / BIN / MySQL的 - 端口= 3309 - 插座= / TMP / oracle_mysql.sock中'
  • 別名瑪麗亞='/ USR /本地/ MariaDB的/ bin中/ MySQL的 - 端口= 3308 - 插座= / TMP / mariadb.sock的的'