MYSQL Code Question

Posted on 2011-10-25
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
    LVL 2

    Accepted Solution

    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
    >>Zones: MySQL Server, MS SQL Server, SQL Server 2008<<
    Is this question related to MS SQL Server?
    LVL 13

    Expert Comment

    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

    Thanks for your help on this!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API ( …
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now