

If you want to make a more complex search you query the schemata table from the information_schema database which contains information about all databases.įor example, the following statement returns database(s) that end with either ‘ db‘ or ‘ schema‘. SHOW DATABASES LIKE pattern įor example, the following command returns database(s) that ends with the string ‘ db‘ mysql> show databases like '%db' In that case, you use the LIKE clause to filter the output of the SHOW DATABASES command to a specific pattern. But you are more interested in listing only those databases which have certain patterns. Suppose, you don’t want to list all the available databases in the MySQL server. The output will be the same as when using the SHOW DATABASES command: mysql> show schemas Ħ rows in set (0.01 sec) Filtering the result So, you can use the SHOW SCHEMAS command as well to list all databases in MySQL server. In MySQL, the schema is the synonym of the database. Now, use the SHOW DATABASES command: mysql> show databases If everything goes well then you will see mysql> on the screen. You give the correct root password of the MySQL server and press enter.

To list all databases in the MySQL database server, first log in to the database server as follows: mysql -u root -p The easiest way to list all the databases available in MySQL is by logging into the MySQL server using mysql client and issuing SHOW DATABASES command. Also, you may want to list all available tables in a particular database or schema and user accounts and their privileges.

#Mysql list databases on server how to#
Summary: in this tutorial, you will learn how to list all the available databases in the MySQL server using the command line and MySQL Command Line tool.Īs a database developer or administrator, the first thing you want to do after logging into the MySQL server is to list all the databases in the MySQL server.
