PHP, MySQL, and Volt ( Maybe ) - [L3th4l] - 13.03.2011
Ok, so I'm using wamp for testing. I started using PHP to create a stats page. The problem is, that when I try to connect the PHP site to the MySQL host, it gives an error about an "Insecure" password.
Error:
Код:
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 C:\wamp\www\database.php on line 2
I tried querying that input shown above:
Код:
SET PASSWORD = PASSWORD('your_existing_password')
But its asking for administrative privileges.
Here's how the PHP code looks like:
PHP код:
<?php
$con = mysql_connect("host", "user", "password");
mysql_select_db("db");
?>
I didn't try opening a support ticket, don't think its that necessary, thought i was doing something wrong. Anyways, I'll be glad if someone helps me resolve this. Thanks.
(Btw, yes i ******d the problem. Most of the answers are about the above input that i showed)
Re: PHP, MySQL, and Volt ( Maybe ) -
Stefan_Toretto - 13.03.2011
Your root password is not ``? I mean blank? I use XAMPP... My brother told me that is better than wamp...
EDIT: or the user that are you using has all the privileges to that database?
Re: PHP, MySQL, and Volt ( Maybe ) -
mamorunl - 13.03.2011
A few things first:
1. @Stefan_Toretto: XAMPP is the follow-up of WAMP and has the more recent versions of PHP, Apache, MySQL etc.
2. WAMP comes with PHPMyAdmin, try to log into there and see if you can change your password there. Also, check that cnf file to see what it does.
I would recommend upgrading to xampp so that you have the most recent version of all services.
Re: PHP, MySQL, and Volt ( Maybe ) - [L3th4l] - 13.03.2011
Sorry if i didn't made a clear point, but I'm trying to connect to an external host. Not localhost, thus i have no administrative privileges.
Re: PHP, MySQL, and Volt ( Maybe ) -
Ashley - 13.03.2011
I wonder if it has anything to do with the external host privileges?
Does your host give you an option to accept external MySQL Connections? It's usually under an option with the MySQL section on cPanel? You should most probably contact your host about it...
Re: PHP, MySQL, and Volt ( Maybe ) -
Stefan_Toretto - 13.03.2011
Quote:
Originally Posted by [L3th4l]
Sorry if i didn't made a clear point, but I'm trying to connect to an external host. Not localhost, thus i have no administrative privileges.
|
Some Hosts doesn't allow external connections...