Difference between revisions of "MariaDB: Manual"

From WIKI
 
(No difference)

Latest revision as of 02:01, 4 October 2019

Create MariaDB user and database

root@notebook:~# mysql 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 38
Server version: 10.3.15-MariaDB-1 Debian 10

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)]> CREATE DATABASE db;
Query OK, 1 row affected (0.021 sec)

MariaDB [(none)]> CREATE USER 'db'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.021 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON db.* TO 'db'@'localhost';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> exit
Bye


Export and import MariaDB database

Export:

root@notebook:~# mysqldump db > db.sql

Import:

root@notebook:~# mysql db < db.sql


Import Ejabberd database new scheme

root@notebook:~# wget https://raw.githubusercontent.com/processone/ejabberd/master/sql/mysql.new.sql
root@notebook:~# mysql ejabberddb < mysql.new.sql