Runtime Creation of New Users

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
BarryW
Posts: 6
Joined: Mon 24 Aug 2009 19:44

Runtime Creation of New Users

Post by BarryW » Fri 18 Jun 2010 20:18

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

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 21 Jun 2010 09:59

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.

BarryW
Posts: 6
Joined: Mon 24 Aug 2009 19:44

Post by BarryW » Mon 21 Jun 2010 15:01

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.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 22 Jun 2010 07:44

If any other questions come up, please contact me.

Post Reply