mysql-linux-mariadb

install

[looser@soalinux ~]$ sudo yum install mariadb-server
Complementos cargados:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolviendo dependencias
--> Ejecutando prueba de transacción
---> Paquete mariadb-server.x86_64 1:5.5.56-2.el7 debe ser instalado
--> Resolución de dependencias finalizada

Dependencias resueltas

=============================================================================================================================================
 Package                             Arquitectura                Versión                             Repositorio                       Tamaño
=============================================================================================================================================
Instalando:
 mariadb-server                      x86_64                      1:5.5.56-2.el7                      InstallMedia                       11 M

Resumen de la transacción
=============================================================================================================================================
Instalar  1 Paquete

Tamaño total de la descarga: 11 M
Tamaño instalado: 58 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Instalando    : 1:mariadb-server-5.5.56-2.el7.x86_64                                                                                   1/1
  Comprobando   : 1:mariadb-server-5.5.56-2.el7.x86_64                                                                                   1/1

Instalado:
  mariadb-server.x86_64 1:5.5.56-2.el7

¡Listo!
[looser@soalinux ~]$

initialization through systemctl:

[looser@soalinux ~]$ sudo systemctl restart mariadb
[looser@soalinux ~]$

[looser@soalinux ~]$ sudo systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: active (running) since lun 2018-05-28 12:58:38 CEST; 22min ago
  Process: 10049 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 10016 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 10047 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ├─10047 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─10216 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariad...

may 28 12:58:34 soalinux.soadomain systemd[1]: Starting MariaDB database server...
may 28 12:58:35 soalinux.soadomain mariadb-prepare-db-dir[10016]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
may 28 12:58:35 soalinux.soadomain mariadb-prepare-db-dir[10016]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
may 28 12:58:36 soalinux.soadomain mysqld_safe[10047]: 180528 12:58:36 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
may 28 12:58:36 soalinux.soadomain mysqld_safe[10047]: 180528 12:58:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
may 28 12:58:38 soalinux.soadomain systemd[1]: Started MariaDB database server.
[looser@soalinux ~]$ sudo systemctl restart mariadb
[looser@soalinux ~]$ sudo systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: active (running) since lun 2018-05-28 13:21:32 CEST; 4s ago
  Process: 10567 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 10534 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 10566 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ├─10566 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─10727 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariad...

may 28 13:21:25 soalinux.soadomain systemd[1]: Starting MariaDB database server...
may 28 13:21:26 soalinux.soadomain mariadb-prepare-db-dir[10534]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
may 28 13:21:26 soalinux.soadomain mariadb-prepare-db-dir[10534]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
may 28 13:21:27 soalinux.soadomain mysqld_safe[10566]: 180528 13:21:27 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
may 28 13:21:27 soalinux.soadomain mysqld_safe[10566]: 180528 13:21:27 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
may 28 13:21:32 soalinux.soadomain systemd[1]: Started MariaDB database server.

basic configuration

[looser@soalinux ~]$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB 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] n
 ... skipping.

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, MariaDB 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!

Cleaning up...

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

Thanks for using MariaDB!
[looser@soalinux ~]$

first access

[looser@soalinux ~]$ mysql -uroot -hlocalhost -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 19
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.44 sec)

MariaDB [(none)]>

create database and user

MariaDB [(none)]> create database soadev1;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]>
MariaDB [(none)]> create user soauserdev1;
Query OK, 0 rows affected (0.02 sec)

MariaDB [(none)]>

grant access to users:

MariaDB [soadev1]> grant all on soadev1 to 'soauserdev1' identified by 'soauserdev1pass';
Query OK, 0 rows affected (0.10 sec)

MariaDB [soadev1]>