Random Blog
Join JournalHome.com.
Create your own free blog today.
Create Your Blog
Flag this entry/bog.
It will be manually reviewed.
Report This!

Journal Home Official Blog

Restore MySQL database from sql dump file?

Posted in PHP Code

This is more of a personal note for myself because I keep forgetting the syntax :p.

When developing web applications I often, 'mess around' with the database and I then need to restore it to make sure everything is running ok, (or simply to run some kind of test again and again).
MySQL, (my current development database here), allows me to reload the db from the command line. And the command is...


z:\mysql.exe - u USERNAME -p DATABASE < dump.sql
Enter password: ********

Replace USERNAME with your database username, DATABASE with your database name and of course the 'dumpo.sql' with the name of your sql dump file.

You will then be asked to enter your password and the update should happen with not too much problems.

if you get an error message like "'mysql.exe' is not recignized as ab internal or external command, ...." this is because mysql is not in your &#xpa;th%, so you will need to run the command above with the full path where mysql.exe is located, (normally in your program files directory).

Share |

06h37 - 5/31/2011 - post comment


Notify me of followup comments via e-mail.

Technorati Tags: , , , ,
Filed under: , , , ,
Share and enjoy
  • Digg
  • del.icio.us
  • DZone
  • Netvouz
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
Last Page Next Page
Description

JournalHome.com has created this blog for the purpose of keeping members and visitors up to date with JournalHome.com site information.
The easiest way to stay up to date is by using the RSS/XML feed.
Place this URL within your rss aggregator and it will automatically update itself whenever a new journal entry is published.


«  May 2012  »
MonTueWedThuFriSatSun
 123456
78910111213
14151617181920
21222324252627
28293031 

Home
User Profile
Archives
Friends
My Wall
Links
Webmaster Forum
Free Blog
Follow JournalHome on Twitter







Recent Entries
- How to moderate thousands of posts in vBulletin 3.x without timeout
- Happy new year!
- Stand up against the Internet blacklist legislation
- Very high server load
- Started facebook promotion - Part 2
Entry Categories
- Contest
- HTML Code
- News
- Web Security
- Politics
- PHP Code
- Changelog