Support » Installing WordPress » WordPress Install Issues

  • I am installing WP 4.9.4 on Windows, have PHP 7.2.3 working when I connect to phpinfo in the browser. When I go to run wordpress install and it asks for the password and username to create the wp-config file, but fails. I get an error that it can’t connect to the database. I can connect fine by doing a testconnection.php. So, I created the wp-config by hand.

    Now, i get the following error…

    “WordPress database error Table ‘wp_database.wp_options’ doesn’t exist for query INSERT INTO wp_options (option_name, option_value, autoload) VALUES (‘nonce_key’, ‘qznisAjIN+^~|CE[|#K M#j~S-lFegQ@r.C?<[ev>_bAmaI?ZR3(7LCu_c+4gy’, ‘no’) ON DUPLICATE KEY UPDATE option_name = VALUES(option_name), option_value = VALUES(option_value), autoload = VALUES(autoload) made by wp_can_install_language_pack, WP_Upgrader->fs_connect, Automatic_Upgrader_Skin->request_filesystem_credentials, WP_Upgrader_Skin->request_filesystem_credentials, request_filesystem_credentials, wp_nonce_field, wp_create_nonce, wp_hash, wp_salt, update_site_option, update_network_option, add_network_option, add_option WordPress database error Table ‘wp_database.wp_options’ doesn’t exist for query INSERT INTO wp_options (option_name, option_value, autoload) VALUES (‘nonce_salt’, ‘/GoA)>3[~26uvP*X4rM qs(fj?l6r{g6[YEwo^X0|d=u5{lC=q1F0RZjLD4hoO@]’, ‘no’) ON DUPLICATE KEY UPDATE option_name = VALUES(option_name), option_value = VALUES(option_value), autoload = VALUES(autoload) made by wp_can_install_language_pack, WP_Upgrader->fs_connect, Automatic_Upgrader_Skin->request_filesystem_credentials, WP_Upgrader_Skin->request_filesystem_credentials, request_filesystem_credentials, wp_nonce_field, wp_create_nonce, wp_hash, wp_salt, update_site_option, update_network_option, add_network_option, add_option”

    I have tried to google and search the forums and I am at a total loss. Any help would be appreciated.

    • This topic was modified 3 months, 1 week ago by  enielsen.
    • This topic was modified 3 months, 1 week ago by  enielsen.
Viewing 9 replies - 1 through 9 (of 9 total)
  • WordPress has a built-in way to attempt to repair your database, but you’ll have to enable this feature first. To do so, you’ll need to access your wp-config.php file, which contains your WordPress installation settings and configuration.
    You can find wp-config in your root WordPress file directory. You can access it by logging into your cPanel, selecting File Manager, and navigating to the folder where you installed WordPress.Once you have wp-config open, add this line of code to the bottom:
    define( ‘WP_ALLOW_REPAIR’, true );
    This line will enable you to optimize and repair your database by navigating to http://www.yourwebsite.com/wp-admin/maint/repair.php (just replace “yourwebsite.com” with your actual URL). You should see the above screen with two options to repair, or repair and optimize your database. Feel free to choose either; just note that optimizing will take longer.

    Sharvin, Unfortunately that didn’t work. That maybe because this is a fresh install and the tables don’t exist yet. The suggestion you gave now gives me the following error when I goto the repair.php page…

    WordPress database error Table ‘wp_database.wp_options’ doesn’t exist for query SELECT option_value FROM wp_options WHERE option_name = ‘siteurl’ LIMIT 1 made by require_once…. (VERY LONG)

    As the above step didn’t work or didn’t apply to you, then the next thing you can do is take a look at your database settings in your wp-config file.You’ll see the login credentials for your database, probably near the top of the file. It should look something like this:

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

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

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

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

    If anyone of these values is incorrect, WordPress will not be able to connect to the database.One way to check your database outside of WordPress is by using PHPMyAdmin, a tool for accessing and editing MySQL databases. PHPMyAdmin is included with most hosting plans, and you can find it in your cPanel dashboard.
    Just be very careful using PHPMyAdmin, since you’ll be dealing directly with your site’s database. Once you’ve logged in to PHPMyAdmin, you will see a list of databases on your server in the left-hand column. Click on the one that matches the name in your wp-config file (it will be the value after DB_NAME, where it says “database_name_here” in the above sample code).Don’t see any databases? Contact your hosting company, since the entire problem may be an issue with your server.

    You can also try out this options:
    Option 1: Test your existing credentials.
    Create a file in your WordPress directory called something like testconnection.php (the name doesn’t matter; just the .php extension). Paste the following code:
    <?php
    $test Connection = mysql_connect(‘localhost’, ‘root’, ‘password’);
    if (!$testConnection) {
    die(‘Error: ‘ . mysql_error());
    }
    echo ‘Database connection working!’;
    mysql_close($testConnection);
    ?>
    Once you’ve created that file, just navigate to the URL of the file in your browser (e.g. your site.com/testconnection.php). You’ll see either a successful connection message, or an error with more details.
    If the username and password aren’t working, you can just create a new one.

    Option 2: Create a new database user and password.
    We can do that using a different tool available in cPanel called “MySQL® Databases.” Go ahead and click on that, then scroll down to the heading: MySQL Users: Add New User.” Choose a username and strong password, and make note of them for your wp-config file. Click “Create User.” Now scroll down to the heading “Add User To Database,” and choose your new username and your WordPress database, and click “Add.” Update your wp-config file with the new username and password.
    Now your database name, username, and password are all correct. That just leaves DB_HOST.
    In most cases, this value will be “localhost,” but it depends on your host’s settings. WordPress has a list of common hosts with their DB_HOST values on their website. If your host isn’t listed there, you can contact your hosting company to ask what value to use.

    3. Still getting the error message? Check with your hosting company
    If you’ve followed the above troubleshooting steps and your website is still down, it could be a problem on your host’s end. Contact your web hosting company’s support and give them all the details of the error and the troubleshooting actions you’ve taken, and they may be able to help you determine the cause of the error.
    Good Luck! I hope this helps you

    Sharvin,

    So, I have checked the wp-config file as you have stated multiple times. Login, passwords, db and host are all correct.

    As for the other steps I have done Option 1 (as stated in my original post) and it works and connects. I have tried Option 2 (Multiple times recreated users – reinstalled everything thinking something may have corrupted) and it doesn’t work. As a reminder I am on windows and do not use linux, so cPanel isn’t an option. I do use MySQL’s Workbench. I have recreated the database, created a separate user with full right permissions (Even used root), used localhost and the ip address. still nothing. And as for Option 3 we don’t use a hosting company this is on my own server.

    Hence my frustration. Shouldn’t be so difficult.

    Sharvin,

    I probably should also address that the Option 1 script I had to modify to use mysqli instead, this is due to newer versions of PHP don’t have or use the old mysql plugin anymore. WordPress recommends the version of PHP I am using and supports mysqli from what I could find in the source wp-db.php

    I am not sure this will work but you can try if this command works
    UPDATE wp_options SET option_value=’YOUR_SITE_URL’ WHERE option_name=’siteurl’
    For Some People this method as work.

    You might also check this link it may help you
    Topic: Error Establishing a Database Connection

    • This reply was modified 3 months, 1 week ago by  Sharvin Shah.
    • This reply was modified 3 months, 1 week ago by  Sharvin Shah.

    Sharvin,

    Well the problem is the tables don’t exist. The install, I am assuming should create them at some point. But isn’t doing so. The database is there and can connect to it.. just no tables are being created by WP on install or something. I feel a step is missing.

    Hi Enielsen,
    I am having the same problem, have you find a solution?

    I installed “Shopstar” theme on my website, and after a couple weeks, the fonts all turned bold. You can imagine how ugly the well designed site now looks.

    Simply, what CSS code would I need to install to remove bold from the text? There is no option whatsoever in the menu settings.

    Also, in this theme, the text won’t “justify” line up, which also makes for ugly looking text lines, instead of the clean lines I had previously had.

    If there is a way to simply “repair” these issues, please let me know.

    Thanks in advance.

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