How do I restore a dump file from mysqldump

0 votes

I was given a MySQL database file that I need to restore as a database on my Windows Server machine.

I tried using MySQL Administrator, but I got the following error:

The selected file was generated by mysqldump and cannot be restored by this application.

How do I get this working?

Aug 18, 2020 in PHP by kartik
• 37,520 points
1,138 views

1 answer to this question.

0 votes

Hello @kartik,

It should be as simple as running this:

mysql -u <user> -p < db_backup.dump

If the dump is of a single database you may have to add a line at the top of the file:

USE <database-name-here>;

If it was a dump of many databases, the use statements are already in there.

Hope it helps!!

Thank you!

answered Aug 18, 2020 by Niroj
• 82,840 points
Does the .sql file contain the CREATE TABLE entries i.e. is it just the CREATE DATABASE entries that are missing?

Hello @Ankit

Yes, it does. Only 2 command are exists CREATE TABLE and INSERT INTO table. 

Related Questions In PHP

0 votes
1 answer

How do I log errors and warnings into a file?

Hello @kartik, Use the following code: ini_set("log_errors", 1); ini_set("error_log", "/tmp/php-error.log"); error_log( ...READ MORE

answered Sep 14, 2020 in PHP by Niroj
• 82,840 points
493 views
0 votes
1 answer

How do I get a file extension in PHP?

Hello @kartik, pathinfo() $path_info = pathinfo('/foo/bar/baz.bill'); echo $path_info['extension']; // "bill" Hope ...READ MORE

answered Sep 16, 2020 in PHP by Niroj
• 82,840 points
974 views
0 votes
1 answer

How do I find the mime-type of a file with php?

Hello @kartik, mime_content_type() is deprecated, so you won't ...READ MORE

answered Nov 16, 2020 in PHP by Niroj
• 82,840 points
2,888 views
0 votes
1 answer

How do I remove quotes from a string?

Hello @kartik, Try this: str_replace('"', "", $string); str_replace("'", "", $string); Otherwise, ...READ MORE

answered Nov 16, 2020 in PHP by Niroj
• 82,840 points
19,807 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
23,012 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
2,995 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,918 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,696 views
0 votes
1 answer

How do I get a YouTube video thumbnail from the YouTube API?

Hello @kartik, Each YouTube video has four generated ...READ MORE

answered Jun 16, 2020 in PHP by Niroj
• 82,840 points
5,308 views
0 votes
1 answer

How do I UPDATE from a SELECT in SQL Server?

Hello @kartik, In SQL Server, use MERGE MERGE INTO YourTable ...READ MORE

answered Jul 21, 2020 in PHP by Niroj
• 82,840 points
939 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP