You get a bonus - 1 coin for daily activity. Now you have 1 coin

MySQL: listing users, databases, tables, and their structure

Practice



First of all, you need to log in to the MySQL server as the root user.

$ mysql -u root -p
Password:


List of users

mysql> SELECT * FROM mysql.user;

The response will look like a standard MySQL table. If you only need to see some of the data, specify the column names separated by commas instead of *.


List of databases in MySQL

mysql> SHOW DATABASES;


List of tables in a database

mysql> SHOW TABLES FROM databasename;


Structure of a specific table

mysql> SHOW COLUMNS FROM databasename.tablename;

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Databases - MySql (Maria DB)"

Terms: Databases - MySql (Maria DB)