WordPress.org

Ready to get started?Download WordPress

Forums

1&1 problems - wordpress not connecting to database (16 posts)

  1. Helsieboo
    Member
    Posted 3 years ago #

    Hi all,

    I hope someone can help me. I use WordPress for my personal sites (3.0.1) and I am hosted on Streamline and have never had any problems with installtion or setting up.

    I am trying to install WordPress for a friend of mine on 1&1 and I am starting to become increasingly stressed as it just will not work. I have uploaded all the files, as normal and inputted the database information. I have double checked it several times and I am 100% certain it is correct. However, everytime I go to install it, the following message comes up:

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at db2346.oneandone.co.uk. This could mean your host's database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    The url is: http://tabletennisetc.co.uk/tabletennis/wp-admin/install.php

    I am at a complete loss and I have no idea what to do. 1&1 are no help - I also tried to install Joomla for my friend a few weeks back, also on 1&1 and it also refused to connect to databases, despite all the information being correct. When I contacted their support, they told me the information was wrong, yet the information they told me to put in was completely identical and now we are at stalemate.

    I need to have this wordpress site installed by the end of Friday and I am becoming increasingly stressed - does anyone know what to do?

    Many thanks.

  2. obscure
    Member
    Posted 3 years ago #

    Log in to the 1and1 control panel and go to "MySQL administration". Click on that to check the status of the database is set to Ready. Then run phpMyAdmin to check that it connects to the database. If it does then quadruple check for a type in your config file.

  3. entrepreblog
    Member
    Posted 3 years ago #

    This is amazzing. I'm used to the simple Godaddy install, and I'm doing this on my own cari.net server. What a nightmare! I'm getting exactly the same thing. I've check and re-checked, created and deleted databases left and right. It's crazy - and it doesn't work. I was supposed to be done with this 6 hours ago. It's like going back to 2003, or something.

    It is NOT a typo in wp-config.php.

    Does anyone know where there are any logs to at least get a * clue about what's happening? I've checked the logs at /var/log/httpd and don't see anything.

  4. Samuel B
    moderator
    Posted 3 years ago #

    Helsieb
    1 and 1 requires you to add this to the .htaccess file in the root

    AddType application/x-httpd-php5 .htm .html .php
    AddHandler x-httpd-php5  .htm .html .php
  5. entrepreblog
    Member
    Posted 3 years ago #

    Well, command mysql works fine, connects with the credentials that are exactly the same as in the wp-config.php file. I can create tables in the database with these credentials. So, clearly that part works. And yes the credentials are the same in the config.

    Still getting ...
    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

  6. Helsieboo
    Member
    Posted 3 years ago #

    Hi all thanks for the help.

    It says ready, phpmyadmin does connect and all the information in config is 100% correct.

    I have now tried the htaccess file and put in root - still no joy. Just to double check, the root directory IS where you typically have the index page, right? I know that's a daft question.

    Becoming increasingly stressed - I hate 1&1 and no point asking them for help as they just tell you the info is wrong, despite it being right. I've even gone as far as directly copying and pasting the info given to me and it still doesn't work.

  7. entrepreblog
    Member
    Posted 3 years ago #

    Yeah, clearly something isn't right with this. But the ISP isn't the problem.

    I also tried using YUM to install wordpress. And it worked! BUT... it was 2.6.5. I decided it would be simpler to install fresh, rather than attempt an upgrade, so I removed that 2.6.5 instance and elected to follow the WP instructions for using wget. And here we are!

    Maybe I should re-think that.

    I'll look around and see if there is a clue left somewhere in WP install log or some system log.

  8. entrepreblog
    Member
    Posted 3 years ago #

    Ok...I've found the usual log files in /var/log, and then tailed the recently updated while I refreshed the failing WP panel - and nothing is showing up.

    Also tried clearing the cache and starting a new browser - nothing!

  9. entrepreblog
    Member
    Posted 3 years ago #

    I also set WP-DEBUG to 'true' - and looked in /wp-content after trying.

    Nothing was generated; at least where this post indicates the log should be found:

    http://andrewnacin.com/2010/03/22/deprecated-functions-and-wp_debug/

  10. entrepreblog
    Member
    Posted 3 years ago #

  11. innerspaeth
    Member
    Posted 3 years ago #

    @helsieboo - I'm having the same EXACT problem. I loved 1&1 until now. I tried everything that you did as well - no luck. So annoying!

  12. mbyers21
    Member
    Posted 3 years ago #

    ok, i just had this problem. and i hate to sound redundant but it's worth saying if it saves anybody any stress. check the hostname information!

    i too copy and pasted the info they gave me at 1&1 and it didn't work. HOWEVER, i noticed when i look at info in the MySQL Administration of the control panel on 1&1, it's slightly different than the info i originally copied. not sure why, but for some reason there were extra letters at the end of the original info they gave me.

  13. Helsieboo
    Member
    Posted 3 years ago #

    That's where I've taken the information from. I'm so baffled.

  14. innerspaeth
    Member
    Posted 3 years ago #

    @helsieboo
    I just spend 2 hours on the phone with 1and1 - it seems like my problems have been solved. I'm not sure what they did, but I basically created another new database then uploaded all my information again and it worked. You might want to try calling them to walk through the process. Don't forget to import all of your data from you old database to the new one!

  15. entrepreblog
    Member
    Posted 3 years ago #

    I tried with the explicit host name from the MySQL console parameters (fcxxxxxx.aspadmin.net)

    I tried with the master admin mySQL credentials - which work fine at the command line.

    I tried with localhost, and with localhost:3306 which is what the mySQL console has as the server name.

    Same negative result.

    And another thing - I turned on debug, but nothing is being written to wp-content.

    Where does debug write to? I also tailed all the usual files in /var/log and ... nothing ...

  16. dstrongbow
    Member
    Posted 3 years ago #

    I was attempting to setup wordpress for the first time today too and was having some similar problems. Finally seem to have solved it by changing the privileges for my user to be explicitly 'localhost' rather than any host '%'.

    i.e.

    GRANT ALL PRIVILEGES ON 'DBname' . * TO 'admin_user'@'localhost';

    instead of

    GRANT ALL PRIVILEGES ON 'DBname' . * TO 'admin_user'@'%';

    HTH someone.

Topic Closed

This topic has been closed to new replies.

About this Topic