MySQL command to show list of databases on server

MySQL command to show list of databases on server

To show a list of all databases on a MySQL server, you can use the SHOW DATABASES command. This command will display a list of all databases on the MySQL server, including both user-created databases and system databases.

To show a list of all databases on a MySQL server, follow these steps:

  1. Connect to the MySQL server using the mysql utility. You can use the mysql utility to connect to the MySQL server as the root user or another user with the appropriate privileges. For example:
refer‮:ot ‬lautturi.com
mysql -u root -p

Enter the password for the user account when prompted.

  1. Use the SHOW DATABASES command to show a list of all databases on the MySQL server. You can use the following command to show a list of all databases on the MySQL server:
mysql> SHOW DATABASES;

This will display a list of all databases on the MySQL server.

  1. Disconnect from the MySQL server. Once you have finished running the SHOW DATABASES command, you can disconnect from the MySQL server by typing exit at the MySQL prompt:
mysql> exit

By default, the SHOW DATABASES command will only show databases that the user has access to. If you want to show a list of all databases on the MySQL server, including system databases, you can use the SHOW DATABASES command with the FULL option:

mysql> SHOW FULL DATABASES;

This will show a list of all databases on the MySQL server, including system databases. You will need to have the appropriate privileges to view system databases.

Created Time:2017-10-30 10:17:51  Author:lautturi