• Hello forum – Might anyone be able to help me with a local host issue? My browser can’t find the database when I’ve been setting up a local host.

    I imported a database (15.5Mb roughly from an existing website) and then tried to bring it up in my browser but it didn’t work.

    I’ve tried with both XAMPP and MAMP and both attempts were unsuccessful.

    Info/things I’ve tried up to this point:
    *2011 MacBook Air
    *I followed the information at https://www.wpbeginner.com/wp-tutorials/how-to-create-a-local-wordpress-site-using-xampp/ as closely as I possibly could when setting up XAMPP.
    *I followed the information at https://skillcrush.com/2015/04/14/install-wordpress-mac/ when setting up the MAMP configuration.

    In both cases, I was unsuccessful and ended up with a similar problem, which was that my browser (Google Chrome) could not find a database successfully.

    *In my wp-config.php file, I edited code to look like this:

    // ** MySQL settings – You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘STW’);

    /** MySQL database username */
    define(‘DB_USER’, ‘root’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ”);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

    Any suggestions or ideas? Things I might be missing?

    I have seen ideas about changing/altering ports, but I don’t know if this is my issue. I have tried 8080 on XAMPP and 8888 and 8889 on MAMP…tried to play around with them a bit. No luck making it work.

    I would be grateful for any ideas or suggestions. Thanks for taking time to look this over!

    Stephen

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try the password “root”. On a Mac it is the username AND password.

    Thread Starter Uneven_Blogger

    (@stephenallen28)

    Thanks HudsonValleyWebDesign — I tried switching to root for the pw but didn’t have any luck.

    Current situation:
    Using MAMP.

    I switched PW to ‘root’ and am still not having any luck.

    I did notice one thing that may or may not be relevant: I have my ports set to 8888 for Apache and 8889 for MySQL.

    Address for phpMyAdmin = https://localhost:8888/MAMP/?language=English

    However, when I open phpMyAdmin, I saw that the server port listed at the top of the page is 8889 (Server: localhost:8889).

    I don’t know if this is relevant or not.

    Any other ideas or suggestions?

    Thanks for your time.
    Stephen

    Dion

    (@diondesigns)

    Based on what phpMyAdmin reported for the server address, you should change the DB_HOST line in your wp-config.php file to the following:

    define(‘DB_HOST’, ‘localhost:8889’);
    
    Thread Starter Uneven_Blogger

    (@stephenallen28)

    Thanks Dion Designs and HudsonValleyWebDesign.

    Still no luck yet, but trying your suggestions.

    To this point:
    I edited code to look like this:
    // ** MySQL settings – You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘STW’);

    /** MySQL database username */
    define(‘DB_USER’, ‘root’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ”);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost:8889’);

    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

    I also tried all combinations of ‘DB_HOST’, ” using ‘localhost:8888’ and ‘localhost:8889’ as well as all combinations of ‘DB_PASSWORD’, ” using ‘root’ and also leaving it blank. (”).

    When I go to localhost:8888 in my url field in my browser, I get a screen that says: Index of
    wordpress/.

    However, in the phpMyAdmin page (url = https://localhost:8888/phpMyAdmin/?lang=en) the server is identified as Server: localhost:8889. Notice that the url identifies localhost:8888 but that the server lists localhost:8889.

    Might this discrepancy be the cause for my problem?

    Any way to fix it?

    Does it matter?

    Thank you all for taking time to help.

    Stephen

    Sorry to ask the obvious, but is MAMP/XAMP running and showing server as active?

    Thread Starter Uneven_Blogger

    (@stephenallen28)

    Okay – I have found a way in. I was not able to figure out what was going on with either MAMP or XAMPP, but but I will share what I ended up doing in case it ends up being useful for someone else:

    *I dowloaded the bitnami WordPress stack and installed it.
    *I clicked “login” in bottom right corner of the bitnami install in order to get into backend.
    *I then logged into backend of my *online* WordPress site that I’ve been trying to work on locally and used the All-in-one WordPress Migration Plugin to download a copy of the site.
    *I then imported this file to the local bitnami site.
    *It all seemed to go fairly smoothly…the only thing I had to do was to turn off maintenance mode on the online site before downloading the import file in order to make sure that I could access a login screen.
    *For whatever reason, the bitnami stack seems to have navigated through whatever struggles that I was having in terms of server access with the other programs.

    Anyhow…I don’t know if this qualifies as a “solution” exactly, but maybe it can be helpful for someone else down the line.

    Thanks all for your suggestions and time.

    Stephen

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘XAMPP / MAMP Can’t Find Database’ is closed to new replies.