Gerando a partir dos fontes do MySQL :: MariaDB :: Percona
Dicas MySQL

Gerando a partir dos fontes do MySQL :: MariaDB :: Percona


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



É possível executar mais de um servidor MySQL no mesmo servidor. Às vezes as pessoas gostariam de instalar outra versão de um banco de dados no mesmo hardware para fins de teste, bem como avaliações.
Instalando os bancos de dados de origem e de instalações personalizadas para cada um é mais fácil do que pode parecer para alguns. Gostaria de sugerir para rever MySQL Sandboxprimeiro, porém, pois permite avaliações e testes para ser feito muito rapidamente e facilmente. No entanto, a instalação da fonte funcionou melhor para mim quando eu fiz algumas comparações. Abaixo está o processo que eu usei. Eu vou estar olhando para construir posts futuros com esses bancos de dados, uma vez que, em seguida, ajustar as configurações.

http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html


Esta é a informação padrão de mysql.com . Eu já tinha MySQL instalado para que eu não execute o seguinte, mas eu queria isso aqui para referência. Você pode comparar estes passos para o MySQL, MariaDB e instalações fonte Percona abaixo também ver como eu atualizei os passos padrão a fim de obter todas as três versões do banco de dados rodando na mesma caixa. (No valor da produção aqui foi feito apenas para testar o processo.)

# 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 script mysql.server para iniciar e parar certifique-se de rever e editar em conformidade.
# 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/
 tmp-oracle_mysql "
# End of source-build specific instructions

I do not like the results
-- Installing: /usr/local/ tmp-oracle_mysql / 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/
 tmp-oracle_mysql
shell> mv usr/local/mysql/ ../ oracle_mysql ;
shell> cd ../; # rm -Rf oracle_mysql-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/ 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 .


# Em seguida comando é opcional 
shell> cp support-files/my-small.cnf / etc / MariaDB. cnf

shell> vi / etc / MariaDB. cnf

port = 3308

socket = / tmp / MariaDB. meia

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




Configuração pós-instalação #
shell> cd / usr / local / Percona 
shell> chown-R Percona.
shell> chgrp-R Percona.

shell> os scripts / mysql_install_db - defaults-file = / etc / percona.cnf - basedir = / usr / local / Percona - skip-name-resolve - datadir = / var / lib / Percona - user = Percona
shell> chown-R Percona / var / lib / Percona / *
shell> # bin / mysqld_safe - defaults-file = / etc / percona.cnf - user = Percona - datadir = / var / lib / Percona / - port = 3307  



shell> # bin / mysql - port = 3307 - socket = / tmp / percona.sock
Welcome to the MySQL monitor. Comandos acabar com, ou \ g.
Sua conexão MySQL id é um
Versão do Servidor: 5.5.30 distribuição Fonte

Copyright (c) 2000, 2013, Oracle e / ou suas afiliadas. Todos os direitos reservados.




Agora eu tenho acesso a todos os três sabores ou MySQL.
Para acesso de clientes fácil Eu adicionei isso ao meu bashrc.:

  • Percona apelido = '/ usr / local / Percona / bin / mysql - port = 3307 - socket = / tmp / percona.sock'
  • oracle_mysql apelido = '/ usr / local / oracle_mysql / bin / mysql - port = 3309 - socket = / tmp / oracle_mysql.sock'
  • apelido maria = '/ usr / local / MariaDB / bin / mysql - port = 3308 - socket = / tmp / mariadb.sock'






loading...



Dicas MySQL








.