0

I just upgraded my developement box's PHP to the latest version, 5.4.5. This developement machine connects to a remote MySQL server, residing on a shared server that I lease from a hosting company.

Trying to connect to my remote MySQL server using simple mysql_connect('myserver.com', 'user', 'password') results in the following error:

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 file.php on line 2

Simply, as advised, just executing:

SET PASSWORD = PASSWORD('my-password');

wouldn't change anything. The same applies when executing

SET SESSION old_passwords=FALSE;

After a bit of searching, I realized that I needed quite deep access to the MySQL server to be able to fix this problem, which I do not have. Trying to execute this query:

UPDATE mysql.user SET Password=PASSWORD('my-password')
  WHERE User='my_user' AND Host='my-server';
FLUSH PRIVILEGES;

Simply gives me the following error:

1142 - UPDATE command denied to user 'u0112918'@'www10.aname.net' for table 'user'

Requests to have the company execute the query for me has, so far, been unsuccessfull. So my question is if there's any way to fix this on the client side, without involving the MySQL server?

Zar
  • 6,786
  • 8
  • 54
  • 76

1 Answers1

1

Hm, try executing the following query through a tool other then PhpMyAdmin, such as Mysql Workbench or through a shell:

SET SESSION old_passwords=0; 
SET PASSWORD = PASSWORD('passwordString');

You should be allowed to change your own password without DML Rights on user-table.

Edit: since it did not resolve the issue - when "read_only" is enabled for the database then you need super rights to change (even your own) password ( http://dev.mysql.com/doc/refman/5.5/en/set-password.html )

Najzero
  • 3,164
  • 18
  • 18
  • Executed that query, it, however, still gives me the same error.. Super wierd. – Zar Aug 02 '12 at 15:27
  • sorry to hear, you can't use any update/insert into the database with that user? Taken from mysql manual: The SET PASSWORD statement assigns a password to an existing MySQL user account. When the read_only system variable is enabled, the SUPER privilege is required to use SET PASSWORD, in addition to whatever other privileges might be required. – Najzero Aug 02 '12 at 15:32
  • Executing the command through MySQL workbench did the trick, have no idea why that is. I'll edit your answer a bit and mark it as answered. Thanks a ton for your help! – Zar Aug 02 '12 at 15:33