DBA Hub

📋Steps in this guide1/1

View database list in mysql

View database list

mysql configurationintermediate
by MYSQL
13 views
1

View database list in mysql

View database list

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
MariaDB [(none)]>
show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| testdb |
+--------------------+
5 rows in set (0.006 sec)
mysql>
SELECT * fROM information_schema.schemata;
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
| CATALOG_NAME | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH | DEFAULT_ENCRYPTION |
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
| def          | mysql               | utf8mb4           | utf8mb4_0900_ai_ci | NULL | NO |
| def          | information_schema  | utf8             | utf8_general_ci | NULL | NO |
| def.         | performance_schema  | utf8mb4           | utf8mb4_0900_ai_ci | NULL | NO |
| def          | sys                 | utf8mb4     | utf8mb4_0900_ai_ci | NULL | NO |
| def          | testdb             | utf8mb4 | utf8mb4_0900_ai_ci | NULL | NO |
| def          | test               | utf8mb4 | utf8mb4_0900_ai_ci | NULL | NO |
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
6 rows in set (0.00 sec)
-- database list that match a pattern
mysql>
show databases like 'test%';
+------------------+
| Database (test%) |
+------------------+
| test |
| testdb |
+------------------+
2 rows in set (0.00 sec)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!