• Resolved Gourab Neogi

    (@gourab7775)


    Hello,

    This is the first time I’m trying to install a WordPress site in my Windows 11 laptop using localhost. But unfortunately at the very end I’m repeatedly facing an error. Please help me out.

    Steps I followed:

    1. Downloaded XAMPP from the official website.
    2. Installed it by following on screen instructions
    3. Opened the XAMPP Control Panel and started the Apache and MySQL services.
      • First I tried starting Apache in XAMPP using port number 80. But the Apache services were not starting. Hence, I changed the port number from 80 to 85 in httpd.conf.
      • In the same file I changed listen 80 to listen listen 85 and changed the servername from localhost:80 to localhost:85.
      • I also changed the port number in httpd-ssl.conf from 443 to 4433 and the port number for listen from 443 to 4433.
      • For MySQL I changed the port number from 3306 to 3307 in my.ini.
    4. Downloaded the latest version of WordPress.
    5. Extracted the wordpress.zip file into the XAMPP’s htdocs folder.
    6. Created a database for WordPress on http://localhost/phpmyadmin and named it wordpress
    7. Gave all the db permissions to the user root .
    8. Opened http://localhost:85/wordpress/ in my Chrome browser and selected my preferred language English
    9. After that I entered the following database details:
      • Database Name: wordpress
      • Username: root
      • Password: ***
      • Database Host: localhost
      • Table Prefix: wp_
    10. Then I clicked the Submit button and faced the following error again and again:error establishing a database connection

    Please let me know what I should do to resolve the error.

    Thank you,

    Gourab

Viewing 7 replies - 1 through 7 (of 7 total)
  • threadi

    (@threadi)

    You must also specify the changed port for MySQL on the host. So probably localhost:3307

    Thread Starter Gourab Neogi

    (@gourab7775)

    @threadi I changed the port number from 3306 to 3307 in my.ini.

    Thank You

    threadi

    (@threadi)

    Yes, that’s why you also need to specify this changed port when installing WordPress. WordPress otherwise assumes 3306.

    Thread Starter Gourab Neogi

    (@gourab7775)

    @threadi I have already tried Database Host: localhost:3307 but still didn’t work.

    Not sure what I am doing worng.

    Thank You

    threadi

    (@threadi)

    Another possibility would be a firewall (perhaps the Windows firewall) that blocks this particular port. I also don’t know why you changed the port in the first place. Port 3306 is not a problem at all, especially with a local installation.

    Thread Starter Gourab Neogi

    (@gourab7775)

    @threadi Thank you for sharing your knowledge to me. I resolved my problem.

    Jorge Luiz

    (@jluizsouzadev)

    @gourab7775 please, could you share us how you’ve solved the issue. That piece of information could be helpful and useful for the WordPress community.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.