Page 1 of 1

Runtime Creation of New Users

Posted: Fri 18 Jun 2010 20:18
by BarryW
I am doing some tests to create users and grant privileges at runtime using the MyDAC MyQuery component in Delphi 7.

Situation: MySQL 5.1 is installed on the server (Windows 2003 SBS) and I am on a workstation running XP Pro SP3.

I can login and access data no problem, however, unable to use the default MySQL root username and password to Create or Grant. I get the error message:

#HY000Operation CREATE USER failed for ...

So what is wrong here? Is there not a way to use the MyDAC components to add users at runtime? There is very little here in the Forums on this matter.

Any help on this would be appreciated.

Thanks

Barry

Posted: Mon 21 Jun 2010 09:59
by Dimon
MyDAC allows to execute the SQL statement to create a user without any problems. The problem can arise because the root user doesn't have the needed privileges.
Please check that you can create a user using any third-party application.

Posted: Mon 21 Jun 2010 15:01
by BarryW
I assumed that MySQL automatically grants root full access to newly created databases... but it does not. I used the MySQL console to grant all to root and now it works fine.
Thank you.

Posted: Tue 22 Jun 2010 07:44
by Dimon
If any other questions come up, please contact me.