• Using Dell PC with Windows and MAMP localhost with ports 8888/8889, MAMP IS running Apache & MySQL, have used root for the user name and password. Have tried blank for password. Still get message: “Error establishing a database connection.” If I enter localhost:8888, there is a list of databases I have tried. I believe MAMP is working.

    If I change the ports to 80, then it says “Apache needs open port 80 which is already being used by another service or application. Please reconfigure APACHE to use free port.” It looks like port 80 is used by the system (NT Kernel & System).

    How can I install WordPress using MAMP?
    Sandi

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator t-p

    (@t-p)

    – “Error establishing a database connection” means that there is a problem with the connection to your database
    – a problem with the credentials stored in the wp-config.php file not matching what mysql expects.
    – Try reviewing the following codex for possible reasons and solutions: https://codex.www.ads-software.com/Common_WordPress_Errors#Error_Establishing_Database_Connection

    Thread Starter SanCP

    (@sancp)

    Thank you for responding, Tara. After selecting English, the database is not supposed to have a wp-config.php file so how can it not match? When I edit the sample and save wp-config.php with the database name, root, root or blank, localhost and wp_ the result is:
    Error in establishing a database connection

    Are there any other suggestions?

    Hi SanCP,

    As you are using the MAMP default ports of 8888 for Apache and 8889 for MySQL, you need to append the MySQL port to the DB_HOST entry. Your items for the DB setup screen on the install should be:

    DB_NAME: whatever you named it (lowercase, no spaces)
    DB_USER: root
    DB_PASSWORD: root
    DB_HOST: localhost:8889

    – leave the Table prefix as-is: wp_

    I just tried this on MAMP for Windows on my Win 10 machine and it works just fine ??

    Cheers!
    Lyle

    @sancp – additionally, these are the two primary ‘culprits’ of the Port 80 conflict and how to resolve them:

    Skype:

    https://docs.serverpress.com/article/34-resolving-the-port-80-conflict-on-windows-systems-running-skype

    World Wide Web Publishing – Windows Service on by default in Windows 10

    https://serverpress.com/forums/topic/windows-10-desktop-server/#post-69907

    Thread Starter SanCP

    (@sancp)

    Thank you Greg! The last option of stopping WWW Publishing Service and making the Startup Type Manual did the trick for me. It was more of a challenge than I wanted it to be, but you helped me to be able to get back to work. Thank You!

    I have the same problem. Tried every single step you described here and still having the same error message. I am on Windows 10 and using xampp. Very basic programming skills. Am only trying to learn everything. What else can I do with this issue?

    biggo

    (@biggo)

    Also I have the same problem after trying a trillion times:
    using the right database name
    using root as default username and pw
    Host: localhost, tried also localhost:8888, localhost:8889 and as suggested elsewhere localhost:3309
    table prefix: wp_

    OS: Win 10

    please help, I am desperate!

    by the way: I am a nooby, dont get too technical!!

    snifflevalve

    (@snifflevalve)

    @worldicana – this is why you should start your own thread, because your’s is not the same as the original poster ??

    I am on Windows 10 and using xampp.

    The OP is using MAMP; not the same default database user credentials as MAMAP. XAMPP is root for the user and empty (blank, nothing, nada, don’t put anything in there) for the password ??

    Cheers!
    Lyle

    snifflevalve

    (@snifflevalve)

    @biggo – Please start your own topic for this as yours may not be exactly like the OPs. You say Win 10 but do not clarify which local server. It makes it difficult to follow if you tag on to someone’s topic which has been resolved for the OP ??

    Cheers!
    Lyle

    worldicana

    (@worldicana)

    I waited for an answer here and didn’t get it. Was lucky enough to find this tutorial which helped me easily and everything started working right away. Hope it helps you too. https://www.youtube.com/watch?v=L-M3d7RAYFw

    worldicana

    (@worldicana)

    I waited for an answer here and didn’t get it. Was lucky enough to find this tutorial which helped me easily and everything started working right away. Hope it helps you too. https://www.youtube.com/watch?v=L-M3d7RAYFw

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Database Connection Error in Installation with MAMP on Dell PC Windows10’ is closed to new replies.