• Prologue:

    I setup MAMP successfully and created local WordPress site.

    Site is 98% done and I’ve been trying to migrate to a remote server with no luck. Tried WP Clone plug-in. Tired Duplicator plug-in. Tried Duplicator/Clone/Migrate plug-in. No good.

    Part of the problem was I (thought) I didn’t have access to website C-panel. According to directions that shouldn’t’ matter, but I guess it does. Anyway, now I have access so I can see remote MySQL settings. Ultimately, I want to get this site up, but that’s not my immediate problem.

    Immediate Problem:

    So I figure, let me try to match database settings because the plug-ins seem to get hung up there. I’ll figure I’ll rename my local WordPress database user and password from ‘root’ and ‘root’ to something unique, then copy those setting and plug them into the remote MySQL so they match.

    I selected the database name in the MAMP local MySQL, “mywebsite,” found an option to rename user and password, selected, “remove old user” (something like that) option and…

    “Error establishing a database connection”

    Nothing works.

    Using this guide, I remapped all the user name and password settings to get the phpMyAdmin window up but I no longer see ‘mywebsite’ WordPress database.

    Question 1:
    Is my WordPress website database intact?

    Question 2:
    How do get things back the way they were, visible mywebsite’ WordPress database in MAMP phpMyAdmin?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jbones

    (@jbones)

    Okay, I’ve found the MAMP folder containing ‘mywebsite’ database:

    Hard Drive > Applications > MAMP > db > mysql > ‘mywebsite’

    My anxiety levels dropped by 70%.

    I had a hypen in the name, so actually it was more like ‘my-website’ that made the folder ‘my@002dwebsite’ which was why when I was mass searching for the name it wasn’t getting any immediate hits.

    So how do I hook my database back into MAMP services?

    Thread Starter jbones

    (@jbones)

    Solved.

    I initially borked everything in phpMyAdmin by choosing Privileges tab > Edit Privileges link > Login information link: and I made a unique user name and password and I think selected the radio button “delete the old one from the user tables”. Everything went to hell after that.

    As for my fix, I’m not saying this is the best way or even a sensible way, this is just how fixed it after a few hours of trial and error (and tears). I’m posting my solution because I hate to leave a thread hanging for the next poor soul in a similar situation.

    So I’m using MAMP 3.5 on MacOSX 10.8.5

    Backup database folder located:

    ‘Hard Drive > Applications > MAMP > db’

    Backup MAMP content folder too if you use the default location:

    ‘Hard Drive > Applications > MAMP > htdocs’

    Stop MAMP servers. Quit application. Go to:

    ‘Hard Drive > Applications >’

    Trash MAMP and MAMP Pro folder. Empty Trash. Download new MAMP package from website. Run installer.

    Now, in your backup ‘db’ folder go into ‘mysql’ folder find the folder name of your database (something like ‘mywebsite’ or whatever you named it) and these files:

    ib_logfile0
    ib_logfile1
    ibdata1

    Copy them in the corresponding ‘db > mysql’ folder location and put you contents of “htdocs” back as well. Set WordPress ‘wp-config.php’ file back to MAMP defaults DB_NAME to ‘mywebsite’, username ‘root,’ and password ‘root’.

    Launch MAMP, start server.

    The problem I had here was that all of the database tables were empty and logging into WordPress Admin panel would start a new WordPress installation and that didn’t help. So…

    Go to phpMyAdmin panel, should be up and running now. Select ‘mywebsite’ database and select the Export tab. Defaults, Export Method: Quick. Format: SQL. Go. You get a page of text. Select all. Copy. Paste into text editor like Text Wrangler (something that doesn’t muck around with formatting). Save file as ‘mywebsite.sql’ somewhere you can find it. (I made a slight variation in the name to make it different not sure if that’s important or not.)

    Uninstall MAMP and MAMP Pro by putting folders in Trash again. Empty Trash. Reinstall using downloaded package. Put “htdocs” contents back. Restart server. Open phpMyAdmin. No databases should be there.

    Click New in the database tree on the left. Give it a name, (again, I made it slightly different to make the sql file I generated). Import tab. Choose File. Point to ‘mywebsite.sql’ file you made earlier. Defaults, and Go. Make sure that WordPress ‘wp-config.php’ file points to a database with the same name.

    Go to localhost:8888 in browser and WordPress first page should be back but click here and there and you’ll quickly notice that links are broken.

    Go to WordPress Admin panel ‘https://localhost:8888/wp-login.php’, login with the username and password you had been using all along, then go to:

    Dashboard > Settings > Permalinks > Check Plain and Save Changes. That should fix the links and you can change it back to whichever format you prefer again.

    Maybe this will be useful for someone else, and if I screwed up something above, it’s because my process wasn’t nearly as linear, so I may have misremembered. But there’s enough to give someone the general idea. Basically, try to get the database to show up by wiping MAMP settings clean and copying in database files. Export the database it if it’s broken, re-import, and reset WordPress permalinks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘MAMP, changed MySQL database password, broke everything’ is closed to new replies.