The quickest noninteractive command is:
mysql -u USER -p -e "SHOW DATABASES;"
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Replace USER with the MySQL account name. The client prompts for that account’s password, executes SHOW DATABASES;, prints the result, and exits. For a server on another host, add -h HOST; add -P PORT when the server listens on a nondefault port.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What the command does
SHOW DATABASES; is MySQL’s canonical statement for listing database names. The command-line client, mysql, can send that statement in either of two ways: with -e (also written --execute) from your normal shell, or after you open an interactive MySQL session.
As an Amazon Associate I earn from qualifying purchases.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →The shell form is useful for one-off checks, scripts, deployment steps, and remote administration because it does not leave you at a mysql> prompt. The complete SQL statement is quoted as one argument so the shell passes it intact, including its space and semicolon.
List databases without opening the MySQL prompt
Local server
mysql -u USER -p -e "SHOW DATABASES;"
- Open your operating system’s terminal.
- Run the command, replacing
USERwith the account you intend to use. - When
mysqlasks for a password, enter it. The password is normally not displayed while you type. - Read the database names printed by the client. Because
-eexecutes the statement and exits, you return to your regular shell when the result is complete.
The semicolon terminates the SQL statement. Keep the double quotes around the whole statement when using this shell form; they prevent the shell from treating the space as an argument separator.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Remote server
mysql -u USER -p -h HOST -e "SHOW DATABASES;"
Use the server’s DNS name or IP address in place of HOST. If the service uses a nondefault TCP port, specify it with an uppercase -P:
mysql -u USER -p -h HOST -P PORT -e "SHOW DATABASES;"
-h selects the host to which the client connects; -P selects the port. These options affect the connection, not the SQL statement or the set of databases the account is allowed to see.
Why use -e?
-e and its long form, --execute, tell the MySQL client to run the supplied SQL and then quit. This is the appropriate form when you already know the statement you want, need to include it in a shell script, or do not want an interactive session. Quote the complete SQL argument whenever it contains spaces or characters that your shell could interpret.
List databases interactively
Start the client without an SQL statement:
mysql -u USER -p
After authentication, the prompt changes to mysql>. Enter:
SHOW DATABASES;
The client prints the result and leaves you in the same session, so you can inspect a database, run another query, or issue additional administrative commands. End the session with exit, quit, or your terminal’s interrupt/EOF method.
Interactive mode is preferable when listing is only one step in a longer investigation. The -e form is more convenient when the list itself is the whole task.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
SHOW DATABASES and SHOW SCHEMAS are equivalent
MySQL treats SHOW SCHEMAS; as a synonym for SHOW DATABASES;. These commands return the same kind of database-name listing:
mysql -u USER -p -e "SHOW SCHEMAS;"
Choose whichever wording matches the terminology used by your team or application. Changing DATABASES to SCHEMAS does not broaden visibility or bypass permissions.
Use the mysqlshow utility
MySQL also supplies a separate command-line utility named mysqlshow. When you invoke it without a database argument, it displays database names:
mysqlshow -u USER -p -h HOST
For a local server, omit -h HOST:
mysqlshow -u USER -p
The MySQL reference describes this behavior as: “If no database is given, a list of database names is shown.” Like SHOW DATABASES, mysqlshow only shows names for which the connected account has privileges. Supply the same connection options you need for the server you are contacting, including -P PORT where applicable.
Choose the right approach
| Approach | How it runs | Best fit | Connection options | Filtering | Visibility |
|---|---|---|---|---|---|
mysql -e "SHOW DATABASES;" |
Executes SQL from the shell and exits | One-off checks and scripted commands | -u, -p, -h, -P |
Use SQL such as LIKE or WHERE |
Controlled by the account’s privileges and server settings |
Interactive mysql |
Opens a mysql> session, then accepts SQL |
Listing followed by more queries | The same client options | Enter a filtered SQL statement at the prompt | Controlled by the account’s privileges and server settings |
mysqlshow |
Utility wrapper; no database argument lists names | A quick utility-style listing | -u, -p, -h, -P |
Use the utility’s supported arguments or run SQL with mysql when SQL filtering is needed |
Shows only databases for which the account has privileges |
The SQL statement is the most direct and portable choice when you need an explicit filter or want the command to be obvious in a script. Interactive mode keeps the connection open for follow-up work. mysqlshow is convenient when all you need is the utility’s database-name view.
Filter the list instead of showing every visible database
Prefix matching with LIKE
To list only databases whose names begin with app, pass a pattern to the SQL statement:
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
mysql -u USER -p -e "SHOW DATABASES LIKE 'app%';"
Here, % matches any sequence of characters. The pattern is part of the SQL, so keep the complete statement inside the shell’s quotes. A pattern such as '%test%' can match names containing test anywhere, subject to MySQL’s name-comparison rules.
Use a WHERE expression for broader filtering
The SQL reference also permits a WHERE expression with SHOW DATABASES. For example:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11mysql -u USER -p -e "SHOW DATABASES WHERE Database LIKE 'app%';"
This form is useful when the condition needs to be expressed as a general SQL predicate rather than a single LIKE pattern. Filtering changes what is printed; it does not reveal databases that the account is not permitted to see.
Why your list may be incomplete
MySQL normally limits visibility by privilege
MySQL normally shows only databases on which the connected account has some privilege. Therefore, a successful command can return a shorter list than the set of databases physically present on the server. A missing name is not, by itself, proof that the database does not exist.
The account’s grants determine the names visible to that account. Run the listing again with an account that has the required access, or ask a MySQL administrator to check the grants when you need a server-wide inventory.
The SHOW DATABASES privilege provides broader visibility
The global SHOW DATABASES privilege permits broader database visibility. It is a privilege decision, not a different command-line syntax. If an administrator grants it, the same SHOW DATABASES; statement can show more names for that account than it did before.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
The server may use --skip-show-database
If the server was started with --skip-show-database, the SHOW DATABASES statement cannot be used unless the account has the SHOW DATABASES privilege. In that configuration, an account that previously relied on ordinary database privileges may receive an error or fail to obtain the expected listing.
When the command behaves differently across servers, check both the account’s privileges and the server’s startup configuration before changing the SQL. The client command is often correct even when the result is intentionally restricted.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot the connection before troubleshooting SQL
Authentication or connection failure
If the client cannot authenticate, the server never reaches SHOW DATABASES;. Verify the user name, password, host, and port. A remote command that omits -h may connect to a local endpoint instead of the intended server; an incorrect -P can point to a different service or a closed port.
mysql -u USER -p -h HOST -P PORT -e "SHOW DATABASES;"
Keep the host and port options in the same command while diagnosing so you know exactly which endpoint is being tested.
Recommended Free Tools
The command runs but names are missing
First confirm that you authenticated as the intended account. Then consider the account’s database privileges, the global SHOW DATABASES privilege, and the server’s --skip-show-database setting. Do not treat a partial result as a complete server inventory unless the account is authorized for that scope.
The shell does not pass the statement as intended
Use one quoted SQL argument:
mysql -u USER -p -e "SHOW DATABASES;"
Unquoted spaces can split the statement into separate shell arguments. Quoting also keeps SQL wildcard and punctuation characters from being interpreted by the shell before mysql receives them.
Best Value
You need to see the result and continue working
Drop -e and open an interactive session:
mysql -u USER -p
Then run SHOW DATABASES; at the prompt. This separates the connection step from the SQL step and lets you issue follow-up statements without reconnecting.
Connection and password practices
Use -p without placing the password directly in the command when you want the client to prompt for it. A prompt avoids exposing the password in the command you are currently typing and keeps the examples suitable for shared shell history. The database list itself is governed by MySQL permissions, regardless of whether you use an interactive or noninteractive command.
Free tools Windows power users keep installed
One-click scans. No signup required.
For a remote listing, make the destination explicit and keep the port with the command when it is nondefault:
mysql -u USER -p -h HOST -P PORT -e "SHOW DATABASES;"
If you are unsure which endpoint a command reached, check the values you supplied rather than inferring the destination from the output. Database names alone do not identify the host on which they were returned.
Practical command patterns
All databases visible to a local account
mysql -u report_user -p -e "SHOW DATABASES;"
All databases visible on a remote host
mysql -u report_user -p -h db.example.internal -e "SHOW DATABASES;"
A remote host on a specified port
mysql -u report_user -p -h db.example.internal -P 3307 -e "SHOW DATABASES;"
Only application databases with a common prefix
mysql -u report_user -p -e "SHOW DATABASES LIKE 'app%';"
The equivalent schema wording
mysql -u report_user -p -e "SHOW SCHEMAS;"
Utility output with mysqlshow
mysqlshow -u report_user -p -h db.example.internal
Each example uses the privileges of report_user. Substituting another account can change the result without changing the command.
A quick decision checklist
- Need one command that returns to the shell? Use
mysql -u USER -p -e "SHOW DATABASES;". - Need to run more SQL after the listing? Start
mysql -u USER -pand enterSHOW DATABASES;. - Prefer the alternate terminology? Use
SHOW SCHEMAS;; it is synonymous withSHOW DATABASES;. - Need a utility that lists names when no database argument is supplied? Use
mysqlshow. - Connecting elsewhere? Add
-h HOST, and add-P PORTfor a nondefault port. - Need a subset? Use
LIKEor aWHEREexpression. - Seeing fewer names than expected? Check account privileges and whether the server uses
--skip-show-database.
What to remember
The essential command is mysql -u USER -p -e "SHOW DATABASES;". It executes the standard SQL statement from your shell and exits. Interactive mysql sessions, the synonymous SHOW SCHEMAS; statement, and the mysqlshow utility cover the other common workflows. Host, port, filtering, and output choices change how you connect or what you display; privileges and the server’s --skip-show-database setting determine which database names can appear.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




