Thursday, June 1, 2023

How to start MariaDB database ?


Start MariaDB database  


[root@10.1.1.1]#

[root@10.1.1.1]#

[root@10.1.1.1]# systemctl status mariadb

● mariadb.service - MariaDB 10.3 database server

   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)

   Active: inactive (dead)

     Docs: man:mysqld(8)

           https://mariadb.com/kb/en/library/systemd/

[root@10.1.1.1]#

[root@10.1.1.1]#

[root@10.1.1.1]#

[root@10.1.1.1]# systemctl start mariadb

[root@10.1.1.1]#

[root@10.1.1.1]#

[root@10.1.1.1]# systemctl status mariadb

● mariadb.service - MariaDB 10.3 database server

   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)

   Active: active (running) since Thu 2023-06-01 23:09:48 IST; 2s ago

     Docs: man:mysqld(8)

           https://mariadb.com/kb/en/library/systemd/

  Process: 22194 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)

  Process: 22060 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)

  Process: 22035 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)

 Main PID: 22163 (mysqld)

   Status: "Taking your SQL requests now..."

    Tasks: 30 (limit: 48777)

   Memory: 84.7M

   CGroup: /system.slice/mariadb.service

           └─22163 /usr/libexec/mysqld --basedir=/usr


Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: which will also give you the option of removing the test

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: databases and anonymous user created by default.  This is

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: strongly recommended for production servers.

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: See the MariaDB Knowledgebase at http://mariadb.com/kb

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: Please report any problems at http://mariadb.org/jira

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: The latest information about MariaDB is available at http://mariadb.or>

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: Consider joining MariaDB's strong and vibrant community:

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[22101]: https://mariadb.org/get-involved/

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal mysqld[22163]: 2023-06-01 23:09:48 0 [Note] /usr/libexec/mysqld (mysqld 10.3.35-MariaDB) starting a>

Jun 01 23:09:48 ip-172-31-19-40.ec2.internal systemd[1]: Started MariaDB 10.3 database server.




[root@10.1.1.1]#
[root@10.1.1.1]#
[root@10.1.1.1]# systemctl start mariadb.service
[root@10.1.1.1]#
[root@10.1.1.1]#
[root@10.1.1.1]#
[root@10.1.1.1]# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-06-05 16:32:48 IST; 3s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 1680 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
  Process: 1611 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
  Process: 1586 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 1649 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30 (limit: 48777)
   Memory: 108.7M
   CGroup: /system.slice/mariadb.service
           └─1649 /usr/libexec/mysqld --basedir=/usr

Jun 05 16:32:48 ip-172-31-19-40.ec2.internal systemd[1]: Starting MariaDB 10.3 database server...
Jun 05 16:32:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[1611]: Database MariaDB is probably initialized in /var/lib/mysql already, not>
Jun 05 16:32:48 ip-172-31-19-40.ec2.internal mysql-prepare-db-dir[1611]: If this is not the case, make sure the /var/lib/mysql is empty before r>
Jun 05 16:32:48 ip-172-31-19-40.ec2.internal mysqld[1649]: 2023-06-05 16:32:48 0 [Note] /usr/libexec/mysqld (mysqld 10.3.35-MariaDB) starting as>
Jun 05 16:32:48 ip-172-31-19-40.ec2.internal systemd[1]: Started MariaDB 10.3 database server.

[root@10.1.1.1]#



Login to MariaDB database 


[root@10.1.1.1]#
[root@10.1.1.1]# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.3.35-MariaDB MariaDB Server

Copyright (c) 2000, 2018, 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 |
+--------------------+
3 rows in set (0.000 sec)

MariaDB [(none)]> 

1 comment:

  1. Could you write blog on manual installation of MariaDB, thanks in advance

    ReplyDelete