mariaDB 설치 및 기본설정

9641 단어 MariaDBMariaDB

mariaDB 설치

(base) user@user-B365M-DS3H:~$ sudo apt-get install -y mariadb-server

mariaDB 접속, 버전 확인

(base) user@user-B365M-DS3H:~$ sudo mysqladmin password 123123

(base) user@user-B365M-DS3H:~$ sudo mysql -u root -p
Enter password: 123123
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 52
Server version: 10.1.47-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

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)]> select version();
+----------------------------------+
| version()                        |
+----------------------------------+
| 10.1.47-MariaDB-0ubuntu0.18.04.1 |
+----------------------------------+
1 row in set (0.00 sec)

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

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

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

MariaDB [(none)]> use test;
Database changed

MariaDB [(none)]> create user 'bit' identified by '123123';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> select Host, User from mysql.user;
+-----------+------+
| Host      | User |
+-----------+------+
| %         | bit  |
| localhost | root |
+-----------+------+
2 rows in set (0.00 sec)

MariaDB [(none)]> grant all privileges on test.* to 'bit'@'%';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> show grants for 'bit'@'%';
+----------------------------------------------------------------------------------------------------+
| Grants for bit@%                                                                                   |
+----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'bit'@'%' IDENTIFIED BY PASSWORD '*E56A114692FE0DE073F9A1DD68A00EEB9703F3F1' |
| GRANT ALL PRIVILEGES ON `test`.* TO 'bit'@'%'                                                      |
+----------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

MariaDB [test]> exit
Bye

좋은 웹페이지 즐겨찾기