Can we create a database with a numeric name with MySQL?



You cannot create database with numeric name as shown below −

mysql> create database 1233;

This will produce the following output −

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 '1233' at line 1

To create a database with numeric name, you need to use backticks around the database name −

create database yourDatabaseName;

Let us implement the above syntax −

mysql> create database `1233`;
Query OK, 1 row affected (0.20 sec)

Now you can switch to the same database −

mysql> use `1233`;
Database changed
Updated on: 2019-12-16T06:46:28+05:30

392 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy