How to view MySQL databases in Linux?
To view MySQL databases, you can use the following command line tool:
- mysql – a popular open-source relational database management system
mysql -u username -p
Afterwards, the username is the database user name. Upon executing this command, the system will prompt for the password.
- display databases;
show databases;
- select the database_name;
use database_name;
The database_name is the name of the database that you want to view.
- Display a list of tables.
show tables;
- Please provide a description of the table named “table_name.”
describe table_name;
table_name is the name of the table to be viewed.
- Retrieve all data from the table named “table_name.”
SELECT * FROM table_name;
table_name is the name of the table to be viewed.
These are some basic commands that you can further explore and use according to your own needs.