Bug connecting to MariaDB (MySQL?) from console application

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Javierus
Posts: 2
Joined: Tue 26 Apr 2022 18:15

Bug connecting to MariaDB (MySQL?) from console application

Post by Javierus » Tue 26 Apr 2022 18:25

Made a simple application with just a form and a button wich connects to a MariaDB DB and does some simple stuff, all fine
The credentials, DB name, user, password and stuff is all hardcoded as const strings (for now)

The application must be a console one; no big deal: new .dpr/proj file with apptype console and dew moew

But now it fails the connection to the MariaDB, with this message:

... (EUniError): "#42000Access denied for user 'HereTheTestUserName'@'%' to database 'TheDatabaseName"

Notice where it indicates the user name: it's not 'username'@'computername.or.whatever' but instead is 'username'@'%'.

Going back to the GUI app, I change the username to a wrong name, and it will complain with a message as 'wrongusername'@'thiscomputer'

The same action on the console name says 'wrongusername'@'%' without any computername, just the % sign

Please, help: this app must be commandline, and I can't deliver it

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Bug connecting to MariaDB (MySQL?) from console application

Post by MaximG » Fri 29 Apr 2022 11:10

Thank you for your inquiry!

Kindly note that the error message'Access denied for user 'YourUserName'@'YourComputerName'' is returned by the server and suggests that the user authentication has failed: no user with the 'YourUserName' name exists, an invalid password was entered, or a user with the 'YourUserName' name has no access rights to the server from the 'YourComputerName' computer.

To resolve the issue, you need to grant the necessary privileges on the YourUserName account or create a user with such privileges. For more information, see the MySQL reference manual: https://dev.mysql.com/doc/refman/8.0/en/grant.html

Should you have any additional questions please do not hesitate to ask.

Javierus
Posts: 2
Joined: Tue 26 Apr 2022 18:15

Re: Bug connecting to MariaDB (MySQL?) from console application

Post by Javierus » Fri 29 Apr 2022 11:15

Thank you very much :)

Yes, you're right; in one place I typed a "-" instead of "_", and each time I compared it, I read them equal while it was different

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Bug connecting to MariaDB (MySQL?) from console application

Post by MaximG » Thu 05 May 2022 17:04

We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning our product usage.

Post Reply