0

I'm new to database and mysql.

After running sudo mysql -u root -p and type in my password, I get into mysql successfully. (I'm under Mac OS X 10.10.)

However, when I tried to create a database, there was something wrong.

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.6.23 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database test
    -> exit
    ->

What's the problem?

1 Answer 1

1

I believe that you may just be missing the semicolon

create database test;
Sign up to request clarification or add additional context in comments.

2 Comments

Sorry to bother again. After I add a semicolon, a database is created and I can see it appears in the result of running show databases;. But where is the file? I run mysql under home directory but I can't find a database file in it?
I believe this will explain the location of the databases stackoverflow.com/questions/26402884/… I would suggest looking for a crash course type tutorial to get generally familiar with working with databases like maybe mysqltutorial.org

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.