Andreas Hunter
Andreas Hunter

Reputation: 5014

How to divide exported mysql database file to parts and import to database?

I have 200 mb exported database file and now I can't import it to hosting database with phpmyadmin because my internet connection is slow. Database from wordpress site. How I can divide it and import to database?

Upvotes: 1

Views: 1681

Answers (2)

jonas3344
jonas3344

Reputation: 201

If you don't have ssh-access there is no way around splitting your file up, so that phpmyadmin can import it without reaching the max_execution_time.

Upvotes: 0

Kamal Soni
Kamal Soni

Reputation: 1552

You can try to zip the mysql database since it is mostly text, it will reduce the size to almost 10-15% to the original size, so possibly around 20-30 mb.

Please do this on your local machine on your command line.

mysqldump -u root -p db | gzip > /tmp/db.sql.gz

then copy the db.sql.gz to your remote server using ssh or whatever is available to you and run the below command.

zcat db.sql.gz | mysql -u user -p db

Upvotes: 1

Related Questions