Instalación Mysql 8.0 Linux

En esta página vamos a indicar los pasos necesarios para isntalar Mysql 8.0 sobre Linux.

El primer paso es bajarnos los paquetes necesarios para realizar la instalación.

1) Listado de rpm bajados para instalarlo

En este enlace podemos ver de forma detallada los paquetes de la instalación que son necesarios instalar y la forma de hacerlo.

https://dev.mysql.com/doc/refman/8.0/en/linux-installation-rpm.html

Estos son los paquetes necesarios para realizar correctamente la isntalación:

oracle@edvmr1p0 MySQL-Server]$ ls -la
total 1476364
drwxr-xr-x 2 root root 4096 Jan 19 2020 .
drwxr-xr-x 7 root root 4096 Feb 3 2020 ..

-rw-r–r– 1 root root 22598996 Sep 23 2019 mysql-commercial-backup-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 40154652 Sep 23 2019 mysql-commercial-client-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 623112 Sep 23 2019 mysql-commercial-common-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 6933028 Sep 23 2019 mysql-commercial-devel-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 23702488 Sep 23 2019 mysql-commercial-embedded-compat-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 3890924 Sep 23 2019 mysql-commercial-libs-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 1377676 Sep 23 2019 mysql-commercial-libs-compat-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 477137056 Sep 23 2019 mysql-commercial-server-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 158334820 Sep 23 2019 mysql-commercial-test-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 21055592 Sep 23 2019 mysql-router-commercial-8.0.18-1.1.el7.x86_64.rpm
-rw-r–r– 1 root root 69390 Oct 10 2019 README.txt
-rwxr-xr-x 1 root root 755879610 Jan 17 2020 V983832-01.zip

2) Instalación paquetes RPM

Instalamos como (root) el paquete: mysql-commercial-common*.x86_64.rpm

oracle@edvmr1p0 MySQL-Server]$ su –
Password:
Last login: Wed May 4 15:42:35 UTC 2022
[root@edvmr1p0 ~]# cd /stage
[root@edvmr1p0 stage]# cd MySQL-Server/
[root@edvmr1p0 MySQL-Server]# yum install mysql-commercial-common*.x86_64.rpm
Loaded plugins: langpacks, ulninfo
Examining mysql-commercial-common-8.0.18-1.1.el7.x86_64.rpm: mysql-commercial-common-8.0.18-1.1.el7.x86_64
Marking mysql-commercial-common-8.0.18-1.1.el7.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package mysql-commercial-common.x86_64 0:8.0.18-1.1.el7 will be installed
–> Finished Dependency Resolution
ol7_MySQL80/x86_64 | 3.0 kB 00:00:00
ol7_MySQL80/x86_64/updateinfo | 71 B 00:00:00
ol7_MySQL80/x86_64/primary_db | 204 kB 00:00:00
ol7_UEKR5/x86_64 | 3.0 kB 00:00:00
ol7_UEKR5/x86_64/updateinfo | 246 kB 00:00:00
ol7_UEKR5/x86_64/primary_db | 46 MB 00:00:01
ol7_addons/x86_64 | 3.0 kB 00:00:00
ol7_addons/x86_64/updateinfo | 144 kB 00:00:00
ol7_addons/x86_64/primary_db | 231 kB 00:00:00
ol7_latest/x86_64 | 3.6 kB 00:00:00
ol7_latest/x86_64/group_gz | 136 kB 00:00:00
ol7_latest/x86_64/updateinfo | 3.4 MB 00:00:00
ol7_latest/x86_64/primary_db | 39 MB 00:00:01
ol7_optional_latest/x86_64 | 3.0 kB 00:00:00
ol7_optional_latest/x86_64/updateinfo | 1.4 MB 00:00:00
ol7_optional_latest/x86_64/primary_db | 5.7 MB 00:00:00
ol7_software_collections | 3.0 kB 00:00:00
ol7_software_collections/updateinfo | 8.9 kB 00:00:00
ol7_software_collections/primary_db | 5.9 MB 00:00:00
Installing:
mysql-commercial-common x86_64 8.0.18-1.1.el7 /mysql-commercial-common-8.0.18-1.1.el7.x86_64 8.5 M
Install 1 Package
Total size: 8.5 M
Installed size: 8.5 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-commercial-common-8.0.18-1.1.el7.x86_64 1/1
Verifying : mysql-commercial-common-8.0.18-1.1.el7.x86_64 1/1
Installed:
mysql-commercial-common.x86_64 0:8.0.18-1.1.el7
Complete!
[root@edvmr1p0 MySQL-Server]#

3) Instalamos los rpm de las siguientes librerías ( mysql-commercial-libs-8.0.x86_64.rpm, mysql-commercial-libs-compat-8.0.x86_64.rpm)

[root@edvmr1p0 MySQL-Server]# yum install mysql-commercial-libs-8.0*.x86_64.rpm
Loaded plugins: langpacks, ulninfo
Examining mysql-commercial-libs-8.0.18-1.1.el7.x86_64.rpm: mysql-commercial-libs-8.0.18-1.1.el7.x86_64
Marking mysql-commercial-libs-8.0.18-1.1.el7.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package mysql-commercial-libs.x86_64 0:8.0.18-1.1.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
Installing:
mysql-commercial-libs x86_64 8.0.18-1.1.el7 /mysql-commercial-libs-8.0.18-1.1.el7.x86_64 17 M
Install 1 Package
Total size: 17 M
Installed size: 17 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-commercial-libs-8.0.18-1.1.el7.x86_64 1/1
Verifying : mysql-commercial-libs-8.0.18-1.1.el7.x86_64 1/1
Installed:
mysql-commercial-libs.x86_64 0:8.0.18-1.1.el7
Complete!
[root@edvmr1p0 MySQL-Server]# yum install mysql-commercial-libs-compat-8.0*.x86_64.rpm
Loaded plugins: langpacks, ulninfo
Examining mysql-commercial-libs-compat-8.0.18-1.1.el7.x86_64.rpm: mysql-commercial-libs-compat-8.0.18-1.1.el7.x86_64
Marking mysql-commercial-libs-compat-8.0.18-1.1.el7.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package mysql-commercial-libs-compat.x86_64 0:8.0.18-1.1.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
Installing:
mysql-commercial-libs-compat
x86_64 8.0.18-1.1.el7 /mysql-commercial-libs-compat-8.0.18-1.1.el7.x86_64 6.4 M
Install 1 Package
Total size: 6.4 M
Installed size: 6.4 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-commercial-libs-compat-8.0.18-1.1.el7.x86_64 1/1
Verifying : mysql-commercial-libs-compat-8.0.18-1.1.el7.x86_64 1/1
Installed:
mysql-commercial-libs-compat.x86_64 0:8.0.18-1.1.el7
Complete!
[root@edvmr1p0 MySQL-Server]#

3) Instalamos la BBDD y sus herramientas relacionadas:

El comando para la instalación son los siguientes:

yum install mysql-commercial-client-8.0.18-1.1.el7.x86_64.rpm

[root@edvmr1p0 MySQL-Server]# yum install mysql-commercial-client-8.0.18-1.1.el7.x86_64.rpm
Loaded plugins: langpacks, ulninfo
Examining mysql-commercial-client-8.0.18-1.1.el7.x86_64.rpm: mysql-commercial-client-8.0.18-1.1.el7.x86_64
Marking mysql-commercial-client-8.0.18-1.1.el7.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package mysql-commercial-client.x86_64 0:8.0.18-1.1.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
Installing:
mysql-commercial-client x86_64 8.0.18-1.1.el7 /mysql-commercial-client-8.0.18-1.1.el7.x86_64 177 M
Install 1 Package
Total size: 177 M
Installed size: 177 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-commercial-client-8.0.18-1.1.el7.x86_64 1/1
Verifying : mysql-commercial-client-8.0.18-1.1.el7.x86_64 1/1
Installed:
mysql-commercial-client.x86_64 0:8.0.18-1.1.el7
Complete!

yum install mysql-commercial-server-8.0.18-1.1.el7.x86_64.rpm

[root@edvmr1p0 MySQL-Server]# yum install mysql-commercial-server-8.0.18-1.1.el7.x86_64.rpm
Loaded plugins: langpacks, ulninfo
Examining mysql-commercial-server-8.0.18-1.1.el7.x86_64.rpm: mysql-commercial-server-8.0.18-1.1.el7.x86_64
Marking mysql-commercial-server-8.0.18-1.1.el7.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package mysql-commercial-server.x86_64 0:8.0.18-1.1.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
Installing:
mysql-commercial-server x86_64 8.0.18-1.1.el7 /mysql-commercial-server-8.0.18-1.1.el7.x86_64 2.0 G
Install 1 Package
Total size: 2.0 G
Installed size: 2.0 G
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-commercial-server-8.0.18-1.1.el7.x86_64 1/1
Verifying : mysql-commercial-server-8.0.18-1.1.el7.x86_64 1/1
nstalled:
mysql-commercial-server.x86_64 0:8.0.18-1.1.el7
Complete!
[root@edvmr1p0 MySQL-Server]#

4) Levantamos el servicio Mysql.

En este punto la instalación ya está realizada, es el momento de levantar los servicios Mysql instalados para poder utilizarlos.
La forma es la siguiente:

systemctl start mysqld.service
systemctl enable mysqld
systemctl status mysqld

root@edvmr1p0 MySQL-Server]# systemctl start mysqld.service
[root@edvmr1p0 MySQL-Server]# systemctl enable mysqld
[root@edvmr1p0 MySQL-Server]# systemctl status mysqld
● mysqld.service – MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-05-06 09:17:26 UTC; 6min ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Main PID: 3350 (mysqld)
Status: «Server is operational»
CGroup: /system.slice/mysqld.service
└─3350 /usr/sbin/mysqld
May 06 09:17:17 edvmr1p0 systemd[1]: Starting MySQL Server…
May 06 09:17:26 edvmr1p0 systemd[1]: Started MySQL Server.

5) Nos conectamos por primera vez a Mysql y cambiamos la password:

5.1) Buscamos la password que se genera de forma aleatoria durante la instalación, en la siguiente ruta y de la siguiente forma:

[root@edvmr1p0 log]# grep ‘temporary password’ /var/log/mysqld.log
2022-05-06T09:17:22.280953Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: <so*cUqfy0ka

5.2) Nos conectamos a la BBDDD.

[root@edvmr1p0 log]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.18-commercial
Copyright (c) 2000, 2019, 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.

5.3) Cambiamos la password temporal

mysql> alter user user ()
-> identified by’***’;
Query OK, 0 rows affected (0.00 sec)

6) Comprobamos que podemos acceder correctamente, con la nueva password introducida anteriormente.

root@edvmr1p0 log]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.0.18-commercial MySQL Enterprise Server – Commercial
Copyright (c) 2000, 2019, 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>

7) Creamos un usuario que será con el que realicemos las pruebas.

mysql> CREATE USER ‘rootphp’@’loclahost’ IDENTIFIED WITH
-> mysql_native_password by ‘***’;
Query OK, 0 rows affected (0.01 sec)

Le damos los permisos necesarios. En este caso le vamos a dar control total sobre la base de datos.

mysql> GRANT ALL on . to ‘rootphp’@’loclahost’;
Query OK, 0 rows affected (0.01 sec)

Hemos detallado los pasos necesarios para poder realizar una instalación simple de Mysql. Se trata de una instalación básica, por lo tanto es recomendable que se revise la documentación para realizar la configuración más idónea según las especificaciones de tu arquitectura, especialmente si no se trata de un entorno de test.

YouTube
LinkedIn