
If you want to know how many databases are available on your mySQL server, you can make use of show databases; query.
Example:mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mydb |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.02 sec)
Do note that its show databases and not database, you will get an error if you forget the "s" at the end.
mysql> show database;
ERROR 1064 (42000): You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server
version for the right syntax to use near 'database' at line 1
More Posts related to MySQL,
- MySQL 1005 Error : SQLSTATE: HY000 (ER_CANT_CREATE_TABLE) Message: Can't create table '%s' (errno: 150)
- MySQL Error :1006 SQLSTATE: HY000 (ER_CANT_CREATE_DB) Message: Can't create database 'mydb' (errno: 28)
- MySQL : Error :1004 SQLSTATE: HY000 (ER_CANT_CREATE_FILE) Can't create file
- MySQL ERROR 1064 (42000): You have an error in your SQL syntax [fix]
- MySQL #6 - Error on delete of './my-database/db.opt' (Errcode: 13 - Permission denied)
- Connection Failed: 1130 PHP MySQL Error
- MySQL Error :1007 SQLSTATE: HY000 (ER_DB_CREATE_EXISTS) Message: Can't create database '%s'; database exists
- How to clear mysql console screen
- MySQL: Error Code: 1175 You are using safe update mode
- MySQL : Error :1000 SQLSTATE: HY000 (ER_HASHCHK) Message: hashchk Server Error
- How to find AUTO_INCREMENT Fields value in MySQL table
- Fix mySQL Error Cant connect to local MySQL server through socket /var/run/mysqld/mysqld.sock ERROR 2002 HY000
- [Fix] MySQL No database selected - ERROR 1046 (3D000)
More Posts:
- Copy all .vcf Mobile Contacts files into one .vcf - HowTos
- How to verify if java is installed on the computer and get version detail - Java
- Unable to find image docker latest locally - Docker
- Android M cannot run app using play button : Android Studio - Android
- How to create SharePoint Document Library - SharePoint
- macOS say command text to speech using various voices and languages - MacOS
- Write javaScript code in Swedish using FikaScript - JavaScript
- Java Read and Write Properties file with Examples - Java