• Resolved JurgenFeuchter

    (@jurgenfeuchter)


    Hello I have quite a few problems with the page Im helping fix. Notice Im not that experienced in wordpress. Right now Im trying to use Php5.4 globaly on my WordPress I have installed. But then comes an error that my Database user and password might be wrong. I changed the password as instructed in quite a few posts from some time ago. But that wont fix the problem. Right now my wordpress does work with the Php5.2 and Mysql5.1 if thats got anything to do with the problem. I cant update the mysql cause of the server my wordpress is in. I read that the problem with having php5.4 and mysql5.1 is that there are some compatibility issues with the hashing of the password. Can anyone point me in the right direction. I need to upgrade my php to 5.4 cause I need to install a plugin which needs it. Any ideas?

Viewing 14 replies - 1 through 14 (of 14 total)
  • JurgenFeuchter

    It maybe that the user you’re trying to use is not having access to that database. We can verify this by opening that database with that user via some other client rather than PHP.
    If you have access to the ssh access to the server, you can try this to open the database via command line.

    mysql -u USERNAME -pPASSWORD

    Then to get the list of databases that user can access type this:

    show databases;

    If that displays you the database you’re trying to use, then it might be the problem you’re suggesting, though I’m setting up a dummy server myself just now, installing PHP5.4 and MySQL 5.1 to verify your hypothesis.

    Thread Starter JurgenFeuchter

    (@jurgenfeuchter)

    The WordPage as of right now it has WP-3.6.1, PHP5.2.17 and MYSQL5.1 and it works just fine. The connection to the database and all the plugins work, but when I change the version of the PHP5.2 to 5.4 the connection to the DataBase fails. I have no idea why. The user and password are correct since when using the PHP5.2.17 it does connect to the Database.

    JurgenFeuchter

    Can you please do the following

    In your wp-config.php file find and replace these global variables as follows

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    if they’re commented out, uncomment them (I mean remove // from the starting of the line) and if they’re not there, put these lines there in that file.

    then open run that WordPress installation, don’t worry its going to work right away, but we’ll have the debug log which will tell us what went wrong.

    Now if you can make sense of the debug log its good. If not copy the debug.log file located at wp-content/debug.log and paste it here so that I can review whats going on.

    Worst case scenario, PHP5.4 might have been compiled with –without-mysql , in which case you’ll have to recompile PHP5.4

    Thread Starter JurgenFeuchter

    (@jurgenfeuchter)

    Here is the LOG.

    [01-Jul-2015 16:47:56 UTC] PHP Warning:  mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /home/hfeuchte/public_html/wp-includes/wp-db.php on line 1142
    [01-Jul-2015 16:48:00 UTC] PHP Warning:  mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /home/hfeuchte/public_html/wp-includes/wp-db.php on line 1142

    Where would I need to put the password for it to rehash? Ive already tried changing the password several time on the Mysql and then on my /wp-config

    JurgenFeuchter

    I found an interesting link on that,
    https://laravel.io/forum/04-16-2014-solving-mysqlnd-cannot-connect-to-mysql-41

    It will then save the password in the new format which will work with PHP 5.4

    Thread Starter JurgenFeuchter

    (@jurgenfeuchter)

    IS there a way to make that but over the mysql database wizard? Cause the server wont allow me to change the password from the SQL Query page. Says my user does not have access D: Ive already tried just updating the password for the user from the wizard, but that wont fix the problem D:
    EDIT:
    Also tried creating a new user and adding it to the Database, but that wont help either D:

    JurgenFeuchter

    Can you use the mysql command over the terminal using SSH access? These commands should work over there.

    Thread Starter JurgenFeuchter

    (@jurgenfeuchter)

    I dont have that much expertise in SSH so Im afraid I cant D: sorry. But what the MySQL database wizard does when creating or setting a password is the same as what the query in the solution you gave me does or not ?

    Thread Starter JurgenFeuchter

    (@jurgenfeuchter)

    By the way thanks so much for sticking with me and helping me ??

    JurgenFeuchter

    I’m not having any experience with UI based MySQL management tools, I alway use terminal, maybe someone else might help you with the MySQL Database Wizard.

    For last, can you try one more thing, create a new user, grant that user permissions to this database and replace user config for this user in wp-config.php , its just a guess but it might work.

    Thread Starter JurgenFeuchter

    (@jurgenfeuchter)

    @gagan Deep Singh
    I tried that already but it didnt work. Oh well D: either way thanks a bunch for your time. Ill see if I can watch a tutorial or something on SSH connection to try what you said.

    I still think it has something to do with the compatibility between the password generated by the MySQL4.1+ and the php5.4. Most likely the hashing is different so the PHP5.4 does not work. Dunno its really weird and I have so long with this problem D: Ill Keep looking. Thanks again Gagan ??

    JurgenFeuchter

    The issue is exactly that, MySQL changed the format it stores the password, earlier it used to store 16 character hash, whereas now it stores 41 character hash, which is more secure, and resilient against brute force attacks.

    I hope you get it resolved soon. You can ask your hosting provider to do that for you, its just a two line job.

    and always welcome ??

    Thread Starter JurgenFeuchter

    (@jurgenfeuchter)

    @gagan Deep Singh

    Just wanted to inform you that updating the password via SSH work wonders ?? Thanks so much for your support and advice ??

    JurgenFeuchter

    I was thinking you might just not play with SSH, but glad you did ??
    SSH is quite useful and I use it to do almost everything on the servers, I simply don’t like finding options in the GUI and it works better and faster for me to use terminal.

    and always welcome ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Running php5.4 and MySQL 5.1 error?’ is closed to new replies.