0

I'm a newbie. I just set up Ubuntu to run on my Chromebook (via Crouton) last week and am currently in the process of setting up several Wordpress sites on localhost. I successfully installed a new Wordpress site yesterday, and I'm able to access the frontend and backend of the site via localhost no problem.

Today I wanted to create another Wordpress site. But when I try to create a new database in mysql using Terminal, I get the following error:

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

How do I figure out which file is causing the syntax error? I checked php.ini, which I edited yesterday, but line 1 looks fine.

2
  • You have to name your new database, like create database MyDB;. And to answer your question: No file caused the error, you did it yourself, right at the terminal ;-) Commented Apr 6, 2016 at 21:01
  • Yes, yes! What a silly mistake! Commented Apr 7, 2016 at 13:16

2 Answers 2

1

The right way to use Mysql CREATE DATABASE statement

CREATE DATABASE my_db;
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! I don't know why I didn't think to check that I was writing the command completely wrong.
1

To my belief, you are missing the database name:

mysql>CREATE DATABASE database_name;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.