Created
November 9, 2023 10:34
-
-
Save SimpleBackups/b0ea2eccc5284b3890bcd932af30cac7 to your computer and use it in GitHub Desktop.
mysql-show-list-all-databases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: https://simplebackups.com/blog/how-to-show-all-mysql-databases/ | |
# How to show a list MySQL databases with mysqlshow | |
mysqlshow -u YOUR_USER_NAME -p | |
# Show a list MySQL databases with SHOW DATABASES | |
mysql -u user -p | |
SHOW DATABASES | |
# Filter a list of MySQL databases | |
# From MySQL CLI | |
SHOW DATABASES LIKE 'wordpress%'; | |
# How to show a list MySQL databases with SHOW SCHEMAS | |
# From MySQL CLI | |
SHOW SCHEMAS; | |
# How to show a list MySQL databases in one mysql command line | |
mysql -u username -p -e "SHOW DATABASES;" | |
# How to show a list MySQL databases with information_schema | |
mysql -u username -p -e "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA;" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment