martes, 21 de noviembre de 2017

Instalar MySQL 5.7 en Fedora 27


Con la llegada de Fedora 27, ahora toca actualizar todos nuestros paquetes a las versiones más recientes. Esto no obligatorio obviamente, pero si es recomendable hacerlo.

La instalación de MySQL, y MySQL Workbench requiere del repositorio oficial de MySQL para permitir la instalación. Además, en los primeros meses usualmente no está disponible Workbench, sin embargo siempre podemos utilizar DBeaver, una alternativa para Workbench.

1.- Primero que nada descargar el repositorio

2.- Instalarlo
$ sudo dnf install mysql57-community-release-fc27-10.noarch.rpm
3.- Habilitar MySQL 5.7.x ya que por default viene activada la opción 5.6.x
$ sudo dnf config-manager --enable mysql57-community
$ sudo dnf repolist enabled | grep "mysql.*-community.*"
$ sudo dnf config-manager --disablerepo mysql56-community-source
$ sudo dnf config-manager --disablerepo mysql56-community
$ sudo dnf -y update

4.- Instalar MySQL
sudo dnf -y install mysql-community-server
5.- Iniciar MySQL
sudo systemctl start mysqld.service
6.- Antes de proseguir con la configuración de MySQL es necesario buscar la contraseña temporal que se le asigna al servidor con el siguiente comando:

sudo grep 'temporary password' /var/log/mysqld.log

Y les mostrará algo así:

2016-06-21T23:50:02.789634Z 1 [Note] A temporary password is generated for root@localhost: ej2VXy(eNN.p

7.- Iniciar configuración de MySQL:

$ mysql_secure_installation

y lanzará en la terminal lo siguiente:

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] n
 ... skipping.

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!




All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


Cleaning up...

Ya han finalizado la instalación de mysql: para probarlo ingresar en la terminal:

mysql -u root -p

Les pedirá la contraseña, al ingresarla les mostrará lo siguiente:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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> 

Si les muestra ese resultado, entonces todo ha ido perfecto.

Debido a que en los repositorios oficiales de MySQL aún no está disponible MySQL Workbench, no se puede instalar.
Pero cuando ya está disponible, la instalación es la siguiente:

Listar todas las utilerias disponibles para instalar:

sudo dnf --disablerepo=\* --enablerepo='mysql*-community*' list available

Y les mostrará una lista de todos los elementos disponibles, lo que hay que hacer es:

sudo dnf install mysql-workbench-community

Gracias por Visitar...

4 comentarios:

  1. Hola a tod@s....me ha surgido un problema al instalar MySQL.

    Me arroja el siguiente error:

    [root@linux jaime]# systemctl start mysqld.service
    Job for mysqld.service failed because the control process exited with error code.
    See "systemctl status mysqld.service" and "journalctl -xe" for details.

    CONSULTO EL ESTADO DEL SERVICIO MySQL:

    [root@linux jaime]# systemctl status mysqld.service
    ● mysqld.service - MySQL Server
    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor prese
    Active: deactivating (stop-sigterm) (Result: exit-code)
    Docs: man:mysqld(8)
    http://dev.mysql.com/doc/refman/en/using-systemd.html
    Process: 10578 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysq
    Process: 10551 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0
    Tasks: 18 (limit: 4915)
    CGroup: /system.slice/mysqld.service
    └─10580 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysql

    ene 17 18:56:47 linux.fritz.box systemd[1]: Starting MySQL Server...
    ene 17 18:56:48 linux.fritz.box mysqld_pre_systemd[10551]: 2018-01-17T17:56:48.9
    ene 17 18:56:48 linux.fritz.box mysqld_pre_systemd[10551]: 2018-01-17T17:56:48.9
    ene 17 18:56:48 linux.fritz.box mysqld_pre_systemd[10551]: 2018-01-17T17:56:48.9
    ene 17 18:56:49 linux.fritz.box mysqld[10578]: Initialization of mysqld failed:
    ene 17 18:56:49 linux.fritz.box systemd[1]: mysqld.service: Control process exit

    CONSULTO EL Journactl -xe:

    [root@linux jaime]# journalctl -xe
    -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mysqld.service has failed.
    --
    -- The result is failed.
    ene 17 18:58:05 linux.fritz.box audit[1]: SERVICE_START pid=1 uid=0 auid=4294967
    ene 17 18:58:05 linux.fritz.box systemd[1]: mysqld.service: Unit entered failed
    ene 17 18:58:05 linux.fritz.box systemd[1]: mysqld.service: Failed with result '
    ene 17 18:58:05 linux.fritz.box systemd[1]: mysqld.service: Service hold-off tim
    ene 17 18:58:05 linux.fritz.box systemd[1]: Stopped MySQL Server.
    -- Subject: Unit mysqld.service has finished shutting down
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mysqld.service has finished shutting down.
    ene 17 18:58:05 linux.fritz.box audit[1]: SERVICE_START pid=1 uid=0 auid=4294967
    ene 17 18:58:05 linux.fritz.box audit[1]: SERVICE_STOP pid=1 uid=0 auid=42949672
    ene 17 18:58:05 linux.fritz.box systemd[1]: Starting MySQL Server...
    -- Subject: Unit mysqld.service has begun start-up
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mysqld.service has begun starting up.

    He probado casi todo lo que me ha ofrecido Google y nada me funciona....no se que hacer. Agradezco de antemano cualquier aporte. Un saludo.


    ResponderBorrar
  2. Qué tal!

    No tienes otro servicio corriendo sobre el mismo puerto?

    Realizaste alguna actualización de una versión pasada?

    ResponderBorrar
    Respuestas
    1. Pues la verdad no se si habrá otro servicio corriendo. No soy muy experimentado en GNU-Linux. Ya llevo varios años utilizando Fedora y me ha ido muy bien, hasta ahora que monte un nuevo PC y he instalado Fedora27.
      Que yo sepa no he realizado ninguna actualización de veriones pasados, es todo una instalación nueva.

      Borrar
  3. Gracias por contestar.
    La verdad no se si habrá otros servicios corriendo por el mismo puerto, no soy muy experimentado en GNU-Linux. utilizo Fedora desde la versión 20 y nunca me había encontrado con tantos problemas como en esta versión nº 27.

    ResponderBorrar