MySQL - cannot create new database

Newbie to Server and MySQL. Using 10.6.5 Server on a Mac Mini.

Under Server Admin I set the Root password, left the default database location at /var/mysql/ and started the MySQL service. All seems fine and the MySQL service light is green.

Using Terminal, if I enter "mysql" then show "databases;" it shows me one database called "information_schema".

Using Terminal, if I log in as the root user, using "mysql -u root -p" then enter the root password, then enter "show databases;" it shows me two databases called "information_schema" and "mysql".

I presume the above two items indicate that things are running fine.

Now, still logged in as root, I try to create a database by entering at the mysql> prompt "create database zzztest;". Nothing happens other than the cursor returns to the start of the next line and further commands such as "exit" do nothing. Needless to say, the new database is not created.

Using Sequel Pro on my desktop machine, I can connect fine to MySQL running on the Mini. When I attempt to create a database, it hangs and I have to force-quit Sequel Pro.

Stumped completed. Anyone have any ideas? Many thanks in advance.

Posted on Jan 5, 2011 6:17 PM

Reply
3 replies

Jan 6, 2011 9:03 PM in response to James Welsby

Try using the mysql workbench app on the server itself (connect as localhost) to create a database. When I've ran into issues, it can come in handy.

http://www.mysql.com/products/workbench/

Eta: I've had that problem in command line...maybe your syntax is wrong. I usually back out with ctrl+c then try to figure what I mistyped, and start over. Still some things I'm learning as well.

Jan 21, 2011 5:57 AM in response to Sheri Nikishin

Sheri - apologies for delay in responding. My subscription emails were not enabled thus I figured no one had responded to my question.

Problem solved quite easily - I ran Disk Utility/Repair Disk Permissions and all is good now. Am not 100% certain but I reckon that not all of the files in /var/mysql were owned by mysql.

Thanks for your input. Greatly appreciated.

Jan 21, 2011 6:51 AM in response to James Welsby

Edit: Whoa... Not sure why this showed up the RSS feed again. Whoops... Anyway...

Here's how I typically create MySQL databases:

$ mysqladmin -u username -ppassword create databasename


Here is [some MySQL set-up info|http://snow.hoffmanlabs.net/node/376] (including a full mysqladmin create sequence in the last section, including setting up privileges for sequel pro or php access) and a [bash mysqladmin database archiving script|http://snow.hoffmanlabs.net/node/1336], and then there is the [main MySQL documentation site|http://dev.mysql.com/doc>.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

MySQL - cannot create new database

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.