• Resolved CapitalWrite

    (@capitalwrite)


    Good Evening, I am going through a training video trying to install WordPress on my PC. I have installed XAMPP, downloaded WP and created a new Database, username and password. I went to the WP folder and opened wp-config-sample.php, and typed in the database name, user name and password in teh appropriate locations. I then saved the file as wp-config.php.

    After typing “localhost/wordpress/wp-admin/install.php” without the quotes into Firefox (my browser), I was supposed to be taken to a WP install screen; however, the browser gave me an error – “Error establishing a database connection.”

    I went back to make sure my DB-name, username and password were typed correctly, and they were. I spent most of the afternoon searching for a solution but with no success. Any help on why I am not going to the install screen would be greatly appreciated.

    Thank you in advance.

    David

Viewing 5 replies - 1 through 5 (of 5 total)
  • There’s something in your database setup that isn’t correct. If the connection details that you’ve set up in your wp-config.php file are correct (double-check them because it’s easy to get them wrong, for all of us!), the only other thing that springs to mind is that your user in MySQL doesn’t have the right permissions set up to access the database. That’s something that you should check.

    As a tip, when I’m doing things locally, I use the ‘Users’ area in phpMyAdmin and use the ‘Create database with same name and grant all privileges.’ option as this ensures that my user has the access permissions needed.

    Thread Starter CapitalWrite

    (@capitalwrite)

    Thank you catacaustic, Although my problem is still not solved, I did at least see that I had not granted all of the proper privileges, and I took care of that, but I did not see the option to ‘Create database with same name and grant all privileges.’ I did double and triple check the wp-config file settings, and they appear to be correct.

    There’s a lot of different versions of phpMyAdmin. It should be there as you’re running your own “server” thorugh your PC. The naming may have changed, but there should be an option close to that when you create a new yser (it it only shown when you create a new user, not for any existing users).

    On my local installs, I always use the default values for the MySQL user for whatever “stack” I am using. I never create a new user; just use the default.

    For XAMPP and WAMPServer those are:

    User: root

    Password: <empty> … do not enter any value

    For MAMP on the Mac and now Windows (beta)

    User: root

    Password: root

    Try this:

    – make sure both Apache and MySQL servers are running
    – rename your existing wp-config.php to something like wp-config_ORG.php
    – this will let the installer run again
    – in phpMyAdmin, create a new, empty DB with a different name (lower case, no spaces), e.g. wordpress2
    – don’t do anything else there ??
    – start the install again with just https://localhost/wordpress , assuming wordpress contains all the WP files and folders and is in your XAMPP/htdocs folder
    – at the first screen, click the Create a Configuration File button
    – at the next screen, click the Let’s go! button
    – at the next screen, enter the following:

    Database name: wordpress2 (or whatever you named it)
    User Name: root
    Password: <empty> … do not enter any value
    Database Host: localhost
    Table Prefix: wp_ (leave as-is)

    – click the Submit button and carry on! ??

    I have done the above literally 100s of times with no issues ??

    Thread Starter CapitalWrite

    (@capitalwrite)

    Thank you catacaustic for pointing me in the right direction.

    2ninerniner2, I followed your instructions to the T, and WP gave me a message that the config file didn’t look like a config file, but that it could help. I’m guessing that my file was somehow corrupted, so I followed the screen prompts by filling in three test boxes and Bingo, I’m up and running.

    Thank you both for your time and expertise. Have a great evening!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Trying to install WordPress on my desktop with XAMPP’ is closed to new replies.