Hi
I need some information, how can i change password for users in table mysql.user via vb.net .
Thank you
Change password via vb.net
Use SET PASSWORD statement:
It is undesirable to edit 'user' table directly.
Code: Select all
SET PASSWORD FOR 'jeffrey'@'%' = PASSWORD('biscuit');
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...
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...
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.
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()