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