Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

mysql

How to Fix the Error 1064 mysql 42000

Sarvech Qadir

The “1064 mysql 42000” error occurs in MYSQL whenever you have named your database with an unacceptable name.

There are two ways you can name a database in MYSQL.

1. Without using backticks

In MySQL, you can create a database without enclosing its name in backticks. Here is an example:

mysql> create database employees-US 

This will give an error since hyphens are not acceptable. You can rename the database to:

mysql> create database USemployees

2. Using Backticks

If you wish to include characters such as hyphens in your database name, enclose the name of the table within backticks as shown below:

mysql> create database `employees-US` 

This will not return an error, and your database will be created successfully.

RELATED TAGS

mysql

CONTRIBUTOR

Sarvech Qadir
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring