• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Little help with SQL Users password

Omegatcu

New Pleskian
So this is a little specific - so I hope somebody can help ;)

I installed PLESK for dev purposes only. So please keep in mind when i ask here for help this is NOT a production installation and PLESK is not accessible over the Internet!

I try to insert the user root with a specific password so my Projects from my old dev machine can be working without changing the credentials in every project.

The following query is whats giving me a headache and I'm sure somebody can tell me the solution.

Code:
UPDATE db_users SET passwd=PASSWORD('xxxx') where login LIKE 'root';

Now the root user exists (yes i added him via SQL because PLESK doesn't let me), but there is probbably something wrong how I set the password here - I'm sure its just another Function or some arguments the PASSWORD('xxxx') function needs.
 
What is the question?
What i have to use - this is my query:

Code:
UPDATE db_users SET passwd=PASSWORD('xxxx') where login LIKE 'root';

and this is what i get back:
Code:
Query OK, 0 rows affected, 1 warning (0.01 sec)
Rows matched: 1  Changed: 0  Warnings: 1


If i set any other value for passwd='xxxx' I get a success.
So whats wrong with my passwd=Password('xxxx') function call?
 
I am sorry, but I still do not understand the question. The statement is basically correct. You may want to set the database name in addition to db_users table, e.g. "UPDATE psa.db_users ...", but else the statement is valid. "0 rows" are affected, because the statement is only executed if the value of passwd changes. If you change the value and run the statement again, no rows will be affected, because there is no need to do the update. If there is no dataset named "root" in the "login" field, this will cause "0 rows" affected, too. I am not sure what this is all for, because even with an entry for "root", this does not enable "root" access.

If you are unsure whether the password is set, you could remove your "root" account and run a query like
GRANT all privileges ON psa.* to root@localhost IDENTIFIED BY 'xxxx';
But again, I don't get the idea why someone would want to do that.
 
thank you for your time - this solved my problem.

I get why its hard to understand - as i said its essentially only an installation for my development. With the change its possible to use all set up projects after I importet my database.
Thank you very much.
 
Back
Top