Ask the Expert

Script can't create database after dumping it

After executing the following command:
echo "drop database jess;" | /usr/local/mysql/bin/mysql -u root
I tried to do the next command:
/usr/local/mysql/bin/mysql -u root < /usr/local/mysql/db_backup/dump-jess.courses.sql
The first commands in the SQL command are:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ jess;
USE jess;
The database was dumped successfully, but when the next command was run, I got the following error:
ERROR 1006 at line 11: Can't create database 'jess'. (errno: 28)
The script that these commands are in is run by root. What happened to my privileges?


    Requires Free Membership to View

This is a good opportunity to introduce the perror utility. The perror utility allows you to get a text description of the error codes that you will sometimes encounter when using MySQL. Here is the output I received in regards to the error number you quoted:

shell> perror 28
Error code  28:  No space left on device
So in this situation, it would appear that MySQL did not find sufficient free space to create the database.

See the following URL for more information on perror: http://dev.mysql.com/doc/mysql/en/perror.html#comments


This was first published in October 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: