• Hello,
    I am trying to create a new test site on localhost but
    am getting an error when trying to open localhost/sitename of
    Error establishing a database connection.
    I created the site and can see the database is created
    with the remark, No tables found in database.

    I have created and am using a copy config.php
    I updated the fields
    define( ‘DB_NAME’, ‘xxxxx’ );
    define( ‘DB_USER’, ‘xxxxxx’ );
    no password
    using localhost

    No other changes have been made

    When I publish a url localhost/site name I get

    Object not found!
    The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
    If you think this is a server error, please contact the webmaster.
    Error 404
    localhost
    Apache/2.4.29 (Win32) OpenSSL/1.0.2l PHP/5.6.32

    Later:
    a url localhost/site name returned
    Error establishing a database connection


    Has anyone any idea where I may be going wrong please?
    any thanks for your help,

    John

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You need to create a database user, with a password, and give it all privs on that database, somethiing like this from the MySQL command line:

    GRANT ALL on DATABASENAME.* to ‘databaseusername@localhost` IDENTIFIED BY ‘databaseuserspassword’;

    Thread Starter johnhardy

    (@johnhardy)

    Hello Steven,

    I am fairly new to WordPress and I am do not understand the process to GRANT ALL on DATABASENAME.* to ‘databaseusername@localhost` IDENTIFIED BY ‘databaseuserspassword’;

    I wondered if you knew of a video or tutorial somewhere that may assist me in carrying this out.

    Many thanks,

    John

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    How are you setting up your MySQL databases?

    Note that both of us can google this for tutorials, but I think it’s better if you do. Meantime, take a look at https://www.ads-software.com/documentation/article/how-to-install-wordpress/#step-2-create-the-database-and-a-user

    Thread Starter johnhardy

    (@johnhardy)

    Thanks Steven,

    I have the php database setup in the normal way, I have set these up for other websites without too many problems and I will delve into this further later.

    I followed https://www.youtube.com/watch?v=Upw5QPhiQUY as a prompt

    I would be interested to have your opinion on the fact that No tables are found in database. Maybe that is to be expected in view that the connection was not established. Perhaps you would comment please?

    Thank you

    John

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If there are no tables, it means you have not run the installation routine for WordPress. You need to fix the connection; you need a database user with a password.

    I think you must to use password, it not will work in other way.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.