• I’m setting up my localhost as a testbed for a client’s live site. This is so I can test caching and CDN because the site is getting big and slow and unwieldy.
    Database is created and copy of wp folder in the correct location. No I want to import the database copy (xxxx.zip) into mamp using phpmyadmin.
    Unfortunately it keeps timing out, presumably because the database has just got too big.
    (phpmyadmin says its size limit is 32mb… my zip file is 9mb but unzipped it is 64mb)
    So have I painted myself into a corner?
    Does Mamp Pro allow for bigger files?
    Do any of the phpmyadmin import parameters actually work? (the tickbox to allow interruptions in case of large files appears to have no effect).
    Any clues would be welcome.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dion

    (@diondesigns)

    MAMP Pro will be of no help. The problem is that phpMyAdmin is extremely limited when it comes to importing databases. There is a solution, however, but it will require some effort on your part.

    The MySQL server has a command-line interface that can be used to import databases, and it has none of the limitations of phpMyAdmin. First, un-ZIP the file to obain the original .sql file. Let’s call it testdb.sql. Next, you will need to go to your system command line, and in Windows, go to the directory where the mysql.exe file is located. Then type the following to test whether you are in the correct location:

    mysql -uroot -p

    MySQL will ask for a password. Type in the password for the root database user (you set it when you installed MAMP); nothing will be echoed. After pressing Enter, you should see a short message from MySQL and the prompt will change to mysql>. If you see this, you’re in the right place! Type quit to exit MySQL.

    I will now assume you have created the database to use for the import; let’s call it testdb. Now enter the following command:

    mysql -uroot -p --default-character-set=utf8 testdb < /path/to/sql/file/testdb.sql

    and press Enter. You will again be asked for the root DB password. MySQl will then start importing the database. Please note that this could take anywhere from a couple seconds to several minutes, depending on the size of the database. Once it completes, the command prompt will re-appear.

    Now go to phpMyAdmin and check the testdb database.

    Thread Starter gladavisj

    (@gladavisj)

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Importing database to localhost’ is closed to new replies.