MySQL Speeding Up Restoration of dump file in MySQL 5.7 - mysql

We have around 20 GB of backup data. we took backup using by below command in MySQL 5.5 Server.
mysqldump -u username -p password (database Name) > Backupfile.sql
Now we are trying to restore same data in MySQL 5.7 Server. after immediate installation of MySQL 5.7.
It's taking huge time to restore the data.
We did search in google, we found this.
https://serverfault.com/questions/146525/how-can-i-speed-up-a-mysql-restore-from-a-dump-file
But its not helping.
Is there any other way to speed up this restoration process.
Thanks...

Related

How can I mysqldump a large database on Windows workstation without it crashing?

I have a very large MySQL database (total 2027 files and 4.81gb in mysql/data) which is used for a Drupal site. I have some work to do on this and have downloaded the database to my workstation (to be strictly accurate, I loaded it into a VirtualBox VM running Windows under OS X), successfully loaded it into mysql (so I actually have the site running in the VM, using Acquia DevDesktop to run everything).
I want to backup the database, so do the classic command-line:
mysqldump -u drupaluser eco > 20160305-eco.sql
Trouble is, the operation causes the mysql server to crash on a very large table. I get the message that mysqldump "lost connection to MySQL server during query when dumping" the table at row 3134695.
And indeed, the server is crashed and has to be restarted.
I wondered whether there might be a memory problem so tried with these options:
mysqldump -u drupaluser --skip-extended-insert --quick eco > 20160305-eco.sql
But this gave me exactly the same error. Has anyone any ideas of mysqldump options that might help me round this?
Read this for general tips on making mysqldump go fast. https://dba.stackexchange.com/questions/20/how-can-i-optimize-a-mysqldump-of-a-large-database
Make sure your database is quiet before dumping it. It should not have other active clients running against it.
You already tried --quick . It keeps your large innodb tables from blowing out your transaction buffers.
Try giving your VM more disk space. You may be running out.
Dump your tables one at a time, biggest first.
Try running your mysqldump on your mac. Your virtualbox vm has an IP address, something like 192.168.137.100. Read this to learn about finding out this IP address. https://forums.virtualbox.org/viewtopic.php?f=1&t=36592
Then, on a shell in your mac do this.
mysqldump -h 192.168.xxx.xxx -u username -p password etc etc
This should connect the mysqldump on your mac to the mysql instance in your vm, and dump the table or tables you mention.

Fastest way of restoring MYSQL Dump

I have a dump of 2gb size and its taking more than 2 days to restore whole database and still going on.
I am using this command to restore my Database from dump file
mysql -uroot -ppassword new_db < old_db.sql
is there any faster way to do the same. so I can wrap up the Restoration task in one day or less.

Transfer of complete databases in Mysql (WAMP)

I am working in a project heavily involving WAMP. The complete size of all the databases on the Mysql server in WAMP is around 150 mb. How do I transfer this between computers ? There seems to be a limit on the size of the file. Altering PHP MyAdmin doesn't seem to help.
Also, I usually import databases individually by creating a database with the same name and then selecting the database file to be imported. However, I have now exported all the databases collectively and it gave me a file called localhost.sql (With 8 databases in it)
How do I import this in a Mysql server in another computer?
Don't use PHPMyAdmin. Instead use mysqldump utility to create a dump file:
mysqldump --user=root --all-databases > dump.sql
This will create a dump.sql with all databases on your server. For information on how to select individual databases/tables see the the documentation
Then on another computer load the dump into mysql
mysql --user=root < dump.sql

How to backup my MySQL's databases on Windows Vista?

How can I backup my MySQL's databases? I'm using Windows Vista and MySQL 5.1.
I have found the folder "C:\Users\All Users\MySQL\MySQL Server 5.1\data" with all my database files and copy them, but how can I restore them if I need?
Thank you.
You could use the mysqldump tool:
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
That way you'd get SQL files that you could just execute.
You can also go surf to localhost/phpmyadmin and go to 'export' and select the databases you want to export.
The backup process does not have anything to do with your operating system. Simply export your databases.
You can back up the database files directly, but this can be dangerous if the database is in active use at the time you do the backup. There's no guarantee that you'll make a consistent and valid backup if a query starts modifying on-disk data. You may end up with broken tables.
The safest route is to use mysqldump to output a set of sql statements which can recreate the database completely (table creation + data) in one go. Should you need to restore from backup, you can simply feed this dump file back to mysql:
mysqldump -p -u username nameofdatabase > backup.sql
and restore via:
mysql -p -u username nameofdatabase < backup.sql
The .sql file is just a plaintext dump of all the queries required to rebuild the table(s) and their data.

How to migrate a MySql 4.x database to MySQL 5.0?

I have a zip file for a Windows MySQL 4.x installation database which includes the MySQL files and the databases files (.myi, .myd, frm). I have a Windows MySQL 5.0 running installation.
I need to bring one of the databases from the zip file to life in the current active MySQL 5.0. How can this be done?
With your first database running in your mysql 4 database, run a mysql dump
mysqldump dbname > dbname.sql
Then load that file up in your mysql 5 database...
mysql -e "create database dbname"
mysql dbname < dbname.sql
Of course you'll have to set up your users manually.