Change password via vb.net

Change password via vb.net

Postby besoft » Fri 16 Sep 2005 08:42

Hi

I need some information, how can i change password for users in table mysql.user via vb.net .



Thank you
besoft
 
Posts: 3
Joined: Fri 16 Sep 2005 08:37

Postby Serious » Fri 16 Sep 2005 13:50

Use SET PASSWORD statement:
Code: Select all
SET PASSWORD FOR 'jeffrey'@'%' = PASSWORD('biscuit');

It is undesirable to edit 'user' table directly.
Serious
 

Postby besoft » Sat 17 Sep 2005 07:07

thx for the answer.

sorry for this basic question

SET PASSWORD FOR 'jeffrey'@'%' = PASSWORD('biscuit');

if i understand this, that is the script...

i would tray this and hope that work-...

It possible do that with query ?

UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='bob' AND Host='%.loc.gov';
FLUSH PRIVILEGES

thx again...
besoft
 
Posts: 3
Joined: Fri 16 Sep 2005 08:37

Postby Serious » Mon 19 Sep 2005 06:48

As described here SET PASSWORD statement is equivalent to the UPDATE mysql.user ...;FLUSH PRIVILEGES; statements.
You can execute these queries with MySqlCommand or with MySqlScript.
Code: Select all
Dim script as MySqlScript
...
script.ScriptText = "UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='bob' AND Host='%.loc.gov';
FLUSH PRIVILEGES;"
script.Execute()
Serious
 

Postby besoft » Mon 19 Sep 2005 07:17

Thank you for help !

You are the best..
besoft
 
Posts: 3
Joined: Fri 16 Sep 2005 08:37


Return to dotConnect for MySQL