Posts tagged as:

mysql

Import a MySQL dumpfile into your database

March 4, 2008

No Gravatar

After you have used MySQL to dump your database, FTP that dump file to an accessible directory on your server.

Once you have uploaded the dump file to your account here, make your way back to command line and get ready to import the file!

Now to import the dump file into MySQL, use the following command at your shell prompt:

# USER is your MySQL username
# DBSERVER is your database servername, not always required
# dbname is your database name<br># dbname.sql is the dump file you are importing
# -p will prompt for your password
 
mysql -u USER -p -h DBSERVER dbname < dbname.sql

If your preferences are properly set, the same thing can be accomplished with:

mysql < dbname.sql

Enjoy!

{ Comments }

214-748-3647

February 27, 2008

No Gravatar

The number is 214-748-3647, and as fate has it…somebody from Texas is very unlucky.

One of the sites I have been working on saves the phone numbers of condominiums to the database. Take a slight oversight on my part, mix in a improperly declared column type, and poof…you have phone numbers storing incorrectly.

What did I learn from this little fiasco? It seems that phone numbers should be stored as strings, and not integers. More importantly, I should never get a phone number that is 231 -1.

{ Comments }