MYSQL Code Question

Posted on 2011-10-25
Medium Priority
Last Modified: 2012-06-21
I have the following dump code in a batch file that dumps mydatabase to a network share...

@echo off
"C:\wamp\bin\mysql\mysql5.1.53\bin\mysqldump" --databases mydb --add-drop-database -uroot -pmypassword >"\\\d$\users\user43\file3\Backups\databasebackup.sql"

My question is, can someone provide the MYSQL code that will import the same data FROM the same location in this code. Or in other words, I just need the MYSQL code to restore a .sql dump. Thanks

Question by:wantabe2

Accepted Solution

DataCruncher earned 2000 total points
ID: 37027714
The following should restore your database in MySQL:

mysql.exe --verbose -uroot -pmypassword mydb <"\\\d$\users\user43\file3\Backups\databasebackup.sql"

Open in new window

LVL 75

Expert Comment

by:Anthony Perkins
ID: 37028639
>>Zones: MySQL Server, MS SQL Server, SQL Server 2008<<
Is this question related to MS SQL Server?
LVL 13

Expert Comment

ID: 37028646
Why not just copy the db files out. To restore just stop services and put the files back and start the service.
LVL 15

Author Closing Comment

ID: 37030400
Thanks for your help on this!

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question