[PHP] Re: SQL Password() function

2005-11-26 Thread Gustavo Narea

Hi.

Yaswanth Narvaneni wrote:

Hi!

Is there a function (or a code snippet) in PHP for mysql password() function?

I 'dont' want to use something like select * from table where
table.passwd=password($passwd);

Is there any other alternate way to do it?


Try this:

?php
$mypassword=this is my password!!!;

$query=mysql_query(SELECT PASSWORD('$mypassword'));

list($mysql_pass)=mysql_fetch_array($query);

mysql_free_result($query);unset($query);

printf( My password is quot;%squot; and Its hash value .
is quot;%squot; computed by the MySQL PASSWORD() function,
$mypassword, $mysql_pass);

?

You don't need a MySQL connection.

Happy weekend.

--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: sql password

2001-12-18 Thread Mike Eheler

yeah

if you just installed, root doesn't have a password.. so you need to not 
specify -p (this tells the server to try and authenticate with an empty 
password, as opposed to attempting to authenticate with no password.. 
there is a difference):

mysqladmin -u root password mypassword

Mike

Jeremiah Jester wrote:

 Im attempting to install mysql. The service started and everything seems to
 be going ok except for that I can't set the root password for the mysql
 server.
 
 To reset password i type:
 
 /usr/bin/mysqladmin -u root -p mypassword
 
 Then I get the following error:
 
 /usr/bin/mysqladmin: connect to server at 'localhost' failed
 error: 'Access denied for user: 'root@localhost' (Using password: YES)'
 
 Can anyone help?
 Thanks,
 JJ
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]