Hi Werkerholic:
I encrypt my password with grant query on one hand, but I want to connect mysql server with php function but i do not want to write my password as bland char without encryption, and do not want to fill my password in the mysql database bland char. I think that php mysql_connect function auto-encrypts the password of a user when connect to the mysql dameon. I think i have to write an encryption php function, but it is not the good idea yet! Good idea of you?
Alan Fang here1
2000/10/31
John Holmes wrote:
How are you encrypting the password?
With the grant command, you should do something like this:
mysql> GRANT ALL PRIVILEGES ON . TO monty@localhost
IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
MySQL will handle the encryption of your password.
If you add users by using INSERT commands instead of GRANT, use the password() function to set your password.
mysql> INSERT INTO user VALUES('localhost','monty',PASSWORD('some_pass'),
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')
Either way, when you use mysql_connect, you don't have to worry about the encryption.
$link_id = mysql_connect("localhost","monty","some_pass");
---John Holmes...