Instalar MySQL 5.6 en CentOs 6.3

Para instalar MySQL 5.6 en Centos 6.3 debemos descargar primero los siguientes paquetes:

  • Shared components
  • Client Utilities
  • MySQL Server

Para ello iremos al sitio de descargas de MySQL y seleccionaremos como distribución “Oracle & Red Hat Linux Enterprise” tal como vemos en la siguiente imagen:

 

mysqlencentos

 

y descargaremos el rpm correspondiente a nuestro servidor en mi caso son las versiones de 64 bits. La descarga podemos hacerla directamente del navegador o con wget desde la consola de comandos como puede verse a continuación:

 

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-client-5.6.11-2.el6.x86_64.rpm/from/http://cdn.mysql.com/
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-shared-5.6.11-2.el6.x86_64.rpm/from/http://cdn.mysql.com/
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-server-5.6.11-2.el6.x86_64.rpm/from/http://cdn.mysql.com/

 

Una vez descargados vamos a revisar si en nuestro sistema están instalados los siguientes paquetes mysql-libs y mysql-server:

 

 yum list mysql-libs
 yum list mysql-server

 

si al revisar la existencia de cualquiera de ellos la consola te muestra algo como lo siguiente:

 

[root@centosvm edgar]#  yum list mysql-libs
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: centos.webxcreen.org
 * extras: mirror.raystedman.net
 * updates: centos.webxcreen.org
Installed Packages
mysql-libs.x86_64                        5.1.61-4.el6                          @anaconda-CentOS-201207061011.x86_64/6.3

 

Entonces ese paquete deberá ser eliminado. Para ello  vamos a ejecutar el siguiente comando de acuerdo a los paquetes que tengas instalados.

*** Importante. Si lo que deseas hacer es actualizar tu instancia de MySQL entonces lo mejor será ejecutar yum-update. Para eso escribiré después otro artículo

 

yum remove mysql-server 
yum remove mysql-libs

 

Después de eliminar los paquetes vamos a instalar Libao, claro usando yum:

 

yum install libaio

 

Y una vez hecho todo lo anterior vamos a instalar nuestro servidor MySQL 5.6. Para ello ejecutaremos lo siguiente en la terminal:

 

[root@centosvm edgar]# rpm -ivh MySQL-server-5.6.11-2.el6.x86_64.rpm

 

y al hacerlo nos aparecerá lo siguiente en la terminal:

 

Preparando...               ########################################### [100%]
   1:MySQL-server           ########################################### [100%]
2013-05-16 22:21:05 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-05-16 22:21:05 4727 [Note] InnoDB: The InnoDB memory heap is disabled
2013-05-16 22:21:05 4727 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-05-16 22:21:05 4727 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-05-16 22:21:05 4727 [Note] InnoDB: Using Linux native AIO
2013-05-16 22:21:05 4727 [Note] InnoDB: Not using CPU crc32 instructions
2013-05-16 22:21:05 4727 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-05-16 22:21:05 4727 [Note] InnoDB: Completed initialization of buffer pool
2013-05-16 22:21:05 4727 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-05-16 22:21:05 4727 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-05-16 22:21:05 4727 [Note] InnoDB: Database physically writes the file full: wait...
2013-05-16 22:21:08 4727 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-05-16 22:21:11 4727 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-05-16 22:21:12 4727 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-05-16 22:21:12 4727 [Warning] InnoDB: New log files created, LSN=45781
2013-05-16 22:21:12 4727 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-05-16 22:21:12 4727 [Note] InnoDB: Doublewrite buffer created
2013-05-16 22:21:12 4727 [Note] InnoDB: 128 rollback segment(s) are active.
2013-05-16 22:21:12 4727 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-05-16 22:21:12 4727 [Note] InnoDB: Foreign key constraint system tables created
2013-05-16 22:21:12 4727 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-05-16 22:21:12 4727 [Note] InnoDB: Tablespace and datafile system tables created.
2013-05-16 22:21:12 4727 [Note] InnoDB: Waiting for purge to start
2013-05-16 22:21:12 4727 [Note] InnoDB: 5.6.11 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2013-05-16 22:21:13 4727 [Note] Binlog end
2013-05-16 22:21:13 4727 [Note] InnoDB: FTS optimize thread exiting.
2013-05-16 22:21:13 4727 [Note] InnoDB: Starting shutdown...
2013-05-16 22:21:14 4727 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2013-05-16 22:21:14 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-05-16 22:21:14 4765 [Note] InnoDB: The InnoDB memory heap is disabled
2013-05-16 22:21:14 4765 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-05-16 22:21:14 4765 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-05-16 22:21:14 4765 [Note] InnoDB: Using Linux native AIO
2013-05-16 22:21:14 4765 [Note] InnoDB: Not using CPU crc32 instructions
2013-05-16 22:21:14 4765 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-05-16 22:21:14 4765 [Note] InnoDB: Completed initialization of buffer pool
2013-05-16 22:21:14 4765 [Note] InnoDB: Highest supported file format is Barracuda.
2013-05-16 22:21:14 4765 [Note] InnoDB: 128 rollback segment(s) are active.
2013-05-16 22:21:14 4765 [Note] InnoDB: Waiting for purge to start
2013-05-16 22:21:14 4765 [Note] InnoDB: 5.6.11 started; log sequence number 1625977
2013-05-16 22:21:14 4765 [Note] Binlog end
2013-05-16 22:21:14 4765 [Note] InnoDB: FTS optimize thread exiting.
2013-05-16 22:21:14 4765 [Note] InnoDB: Starting shutdown...
2013-05-16 22:21:16 4765 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

 

De esta manera tendremos instalado nuestro servidor MySQL cuyo password de root puede encontrarse en el archivo /root/.mysql_secret tal y como se indica en el texto resultante en la consola veamos si esto es correcto. Abriremos con nano o vi el archivo mencionado encontrándonos lo siguiente:

 

# The random password set for the root user at Thu May 16 22:21:12 2013 (local time): cm0dvscf

 

Ahora, vamos a instalar los paquetes faltantes:

 

[root@centosvm edgar]# rpm -ivh MySQL-client-5.6.11-2.el6.x86_64.rpm 
Preparando...               ########################################### [100%]
   1:MySQL-client           ########################################### [100%]
[root@centosvm edgar]# rpm -ivh MySQL-shared-5.6.11-2.el6.x86_64.rpm
Preparando...               ########################################### [100%]
   1:MySQL-shared           ########################################### [100%]

 

Y ahora vamos a iniciar nuestro servidor MySQL:

 

[root@centosvm edgar]# service mysql start
Starting MySQL. SUCCESS!

 

Como podemos ver hasta este punto nuestro servidor MySQL se encuentra instalado y ejecutándose. Así que para finalizar este artículo nos conectaremos al servidor y actualizaremos nuestro password:

 

[root@centosvm edgar]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.11

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

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MYPASSWORDSECRETO');
Query OK, 0 rows affected (0,00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,00 sec)

mysql>

 

Y hemos terminado de instalar MySQL 5.6 en nuestro servidor Centos 6.3.

 

3 Comments

1 Trackback / Pingback

  1. Instalar MySQL 5.6 en Fedora 19 | Blog del Poli

Deja un comentario