MySQL List Databases

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/mysql-list-databases-mysql-show-databases/
PINTEREST
PINTEREST
INSTAGRAM

MySQL is very popular opensource database. MySQL is created by MySQL AB a Swedish company and then bought by Sun. Sun is bought by Oracle and MySQL is currently owned by Oracle. MySQL is very popular at opensource community. In this post we will look how to list databases in MySQL.

Check MySQL Service Status

We need to be sure that MySQL daemon is running we will check with following systemctl command.

Connect MySQL Server

We will use mysqlserver tools to connect MySQL daemon. mysql is most used command line tool to connect and manage MySQL server. We will connect server by running mysql command with sudo which means with root privileges.

$ sudo mysql -u root

Other way to connect MySQL daemon is providing password with -p parameter

MySQL List/Show  Databases

We will usage MySQL command show databases to list databases. Using semicolon at the end of the command is important otherwise the command will fail.

List Databases From Bash

We can list MySQL databases without entering mysql tool command  line through bash. We will use similar command to connect MySQL database but providing show database command as parameter. We will use MySQL show databases.

We have issued mysql command with -e parameter. show databases; runs as a mysql connect in the mysql shell.

LEARN MORE  How To Recover Deleted Files In Linux?

Here is eveything is similar to the previous example except hostname which is provieded as -h 192.168.122.211. We provide hostname as remote host not localhost. To connect remote host firewall must give access to the port and MySQL daemon should be listening specified IP’s interface.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/mysql-list-databases-mysql-show-databases/
PINTEREST
PINTEREST
INSTAGRAM

2 Replies to “MySQL List Databases

Leave a Reply

Your email address will not be published.