How can I view all databases in MySQL?
In MySQL, you can view all databases by using the command SHOW DATABASES. The specific steps are as follows:
- Open the MySQL console. You can log in to the MySQL console using the following command:
mysql -u your_username -p
Your_username is your MySQL username. You will then be prompted to enter your password.
- After entering the password, proceed to the MySQL console.
- Use the SHOW DATABASES command to view all databases. Enter the following command:
SHOW DATABASES;
- After executing the command, MySQL will display a list of all the databases.