Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : Importing Large Databases via Command Line / Terminal



Normal Mode | Print  

 Importing Large Databases via Command Line / Terminal, AMPPS Import Database in Terminal (3 Replies, Read 10055 times)
foxyhare
Group: Member
Post Group: Newbie
Posts: 10
Status:
I've seen this asked a lot and so I'll give a little help:

Scenario: You have a database file that's too large for import. What do you do?

Solution: Use your Terminal to import the database, within a few following steps:

1. Open your AMPPS install and START / load your environment.

2. In the AMPPS Control Center window, click the MySQL tab (on the lefthand side).

3. In this new window, click the Configuration item / link.

4. This will open your default editor, you'll want to modify the following:

max_allowed_packet

For most standard uses you should need anymore than 1000M here.

There are two areas for this to be changed, so do a search all and edit.

5. Save your changes and be sure to restart both Apache and MySQL.

6. Open your Terminal.

7. Easiest to move the database file to your desktop for path convenience.

8. If you've not already, create the database or install being replaced.

So for example, if installing WordPress, create your Installation via Softaculous.

Remember the name of the database when creating it, you'll need it shortly.

9. In your Terminal, use the following command line:

/Applications/AMPPS/mysql/bin/mysql -u root -p DATABASE_NAME < /Users/USERNAME/Desktop/DATABASE_FILE_NAME.sql

The CAPITAL names will require being replaced with your own specific uses:

DATABASE_NAME: This is the name of the database your wanting to import to.
USERNAME: This is the name of your device/computer user currently being used.
DATABASE_FILE_NAME: This is the SQL file name that you moved to your desktop.

*Important: If you did not move the database .sql file to your desktop, then you'll want to change the path the reflect it's location. So for example, if you left it in your "downloads" folder you'd want the path to reflect that folder name.

On running the command, it will prompt you for a password. This is the password of your root user in MySQL. So if this is a default installation of AMPPS with no customization, chances are you're using the default password and that is "mysql".

10. Once done, you can check the database to see if the import was successful.

If done correctly, there should be no issues.

You may want to go in and edit the URL paths in the database tables, especially if using WordPress, you'll want to edit the wp_options table to reflect the new localhost URL that you're using.

Hope it helps!
IP: --   


Threads
 foxyhare   Importing Large Databases via Command Line / Terminal, AMPPS Import Database in Terminal (3 Replies, Read 10055 times)
    |--  foxyhare   Was going to...   on November 13, 2016, 8:15 am
    |--  jumla40_guy   This is the...   on November 25, 2016, 6:16 pm
    |--  jumla40_guy   If your DB...   on November 25, 2016, 6:32 pm

« Previous    Next »

Normal Mode | Print  



Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is May 25, 2024, 5:55 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.022