CodeIgniter Forums
Database Error while connecting from Localhost - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Database Error while connecting from Localhost (/showthread.php?tid=67782)

Pages: 1 2


RE: Database Error while connecting from Localhost - JayAdra - 04-11-2017

What may be happening with the DB not showing in phpMyAdmin running under MAMP is that you have a manually installed mysql and a different version installed automatically by MAMP?

That MAMP welcome page also had some MySQL default details listed. Try using those in your CI config file, i.e.

Host: localhost
U: root
P: root

Also import your SQL file using phpMyAdmin, so the DB is installed on the same version/location of MySQL which MAMP uses when looking for it.


RE: Database Error while connecting from Localhost - SDillon001 - 04-12-2017

So I figured this out, thanks very much for all of your help! You were right, I had installed the database via terminal and it uploaded to a different location. That's why it was not showing up in MAMP > PHPMyAdmin. I had followed a Codeigniter tutorial which imported the DB from the terminal - then ran the internal PHP sever from the terminal php -S localhost:8080. This is what was causing the database error - there was NO DATABASE! MAMP couldn't see the DB that was uploaded to the terminal location.

Also, when I tried to upload the DB into phpmyadmin it was too large, so I had to download it in two separate files from my server. Compressing both files into a zip file before uploading helped also.

It's running locally now on MAMP. Thanks again!


RE: Database Error while connecting from Localhost - JayAdra - 04-12-2017

Glad to hear you got it sorted, and thanks for posting your solution in case others have the same problem Smile