Solved

Delphi and MySQL

Posted on 2004-03-29
11
499 Views
Last Modified: 2010-04-05
I installed MySQL, and I'm trying to use dbExpress to connect to MySQL database using Delphi 7, I get unable to load mysqllib.dll, I copy this library to system directory without success.

Anybody face this problem and solve it befor?

Motaz
0
Comment
Question by:Motaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 125 total points
ID: 10714289
I use Zeos Database Objects to connect to MySQL with good result.
You can download from Torry http://www.torry.net/pages.php?id=547.


Regards,
  Tomas Helgi
0
 
LVL 7

Author Comment

by:Motaz
ID: 10722017
Thanks but it is not free, I want to use borland dbExpress

Motaz
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 10722250
No this is Open Source. Check out http://www.zeoslib.net/

Regards,
  Tomas Helgi
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Author Comment

by:Motaz
ID: 10730263
I installed the package, and I get an old version of libmysql.dll which makes dbExpress works, but I get invalid login name/password message, and I'm sure that I'm entering the correct user name and password.
I test it with local and remote database and I get the same error

Motaz
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 10730501
Have you checked for case-sensitivity on the username / password ?
And also if the user is written like user@localhost or user@mydomain.com (those users has to have access rights in MySQL as well)
MySQL recoginizes the user as user@....

Regards,
  Tomas Helgi
0
 
LVL 7

Author Comment

by:Motaz
ID: 10730812
I tried user@computername without success, but how can I gave the user rights for a database?

Motaz
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 10730930
Check this manual http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#User_Account_Management
for managing user accounts and privilages.

Regards,
  Tomas Helgi
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 10731100
shell> mysql --user=root mysql
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
    ->     ON bankaccount.*
    ->     TO 'custom'@'localhost'
    ->     IDENTIFIED BY 'obscure';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
    ->     ON expenses.*
    ->     TO 'custom'@'whitehouse.gov'
    ->     IDENTIFIED BY 'obscure';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
    ->     ON customer.*
    ->     TO 'custom'@'server.domain'
    ->     IDENTIFIED BY 'obscure';
The three accounts can be used as follows:

The first account can access the bankaccount database, but only from the local host.
The second account can access the expenses database, but only from the host whitehouse.gov.
The third account can access the customer database, but only from the host server.domain.


Regards,
  Tomas Helgi
0
 
LVL 7

Author Comment

by:Motaz
ID: 10750786
I still get invalid user name/password,
How can I create new user?

Motaz
0
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 10751668
The above GRANT functions creates new user.


Regards,
  Tomas Helgi
0
 
LVL 7

Author Comment

by:Motaz
ID: 10830781
Finally it works!
I used root and blank password
Motaz
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error E2158 compiling with Delphi XE10 Seattle 2 127
Convert a string into a TDateTime 5 73
Delphi: ForceDirectory plain function 7 50
DBCtrlGrid, Delphi, Scroll 7 33
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question