Solved

MYSQLCONNECTION fails on My SQL 5.2.38

Posted on 2012-04-01
9
1,172 Views
Last Modified: 2012-04-03
After Installing My SQL 5.2.38 , I could connect to using the BDE OBDC components. I tried many times to connect to it via the Data explorer Server Name , Database name, User name and password . For the Server Name I used the name of the Server Instance on the Server Administration Local MySQL55. When I tested the connection I got a message back Borland.Data.TDBXError: DBX Error:  Driver could not be properly initialized.  Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path.

Is this a typical problem with the connection components and My SQL 5.2.38, or Im doing something completely wrong?

Thanks,
Mike
0
Comment
Question by:miker454
  • 5
  • 4
9 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
MySQL Workbench 5.2.38 and Delphi / Borland are not directly connected.  To connect to MySQL, you need a user with the appropriate connection privileges defined.  http://dev.mysql.com/doc/refman/5.5/en/adding-users.html   And here is the link to the ODBC connector: http://dev.mysql.com/downloads/connector/odbc/
0
 

Author Comment

by:miker454
Comment Utility
I actually used the MySQL workbench that is a visual interface for windows and set up a connection with a connection name , Hostname, port, Username, and password. As well as Server instances that indentifies the directory where the data is to be stored.
I could not connect to the My SQL using the data explorer and MYSQL.

Thanks,
Mike
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Have you installed the MySQL ODBC connector?  That must be installed.  Here is some info on BDE ODBC with MySQL/ODBC: http://dev.mysql.com/doc/refman/5.5/en/connector-odbc-usagenotes-apptips.html
0
 

Author Comment

by:miker454
Comment Utility
On the Windows 2008 server I can actually run the  MySQL ODBC 5.1 driver connector fill in the Data Source Name, User, TCI/IP Server, port 3306, password, and the database and it works fine. I test it and it is succesfull. On the client (windows 7 computer) I fill the same names and ports and it fails to even see the databases and it gives connection error when we test the connection. Connection Failed: [HY000][MySQL][ODBC 5.1 DRIVER]Can't connect to MySQL server on 'localhost' (10061) . Is there some details in the details tabs that needs to filled in for the client machine that I'm overlooking? I disabled the firewall on both the client and server. Not sure what else to do.


Thanks,
Mike
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Since your original user was set up for 'localhost', that won't work from another machine.  You probably need to create another MySQL user with the same username and password but with the 'anyhost' connection option.  See the link above about adding users.  Adding the user also includes adding the type of connection that is allowed and you have to make sure that user has permissions on the database also.
0
 

Author Comment

by:miker454
Comment Utility
Thanks for the help Dave. I've set up My SQL server on both the local computer and the server computer. It took me while , but with the help of few on here I have set up an ODBC for both Databases (the local and the MSQLserver on the server) .  I can use the ODBC with the BDE, but I would like to use DBExpress  Data Explorer since they it is 64 bit. Using the Data Explorer to first try to connect to the MySQL in the local computer, I filled in the the Data Explorer:
Server Name: localhost
Database Name: mysql
User Name : root
Password :*******  
After clicking the test connection I get this message :
Borland.Data.TDBXError: DBX Error:  Driver could not be properly initialized.  Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path.

The Localhost database is active and root is the User name on the Database instance. I figure if I cannect to the local database first, I can then connect to the database on the server computer later (deal with other issues like the firewall). I'm assuming the db Express connects to the database instance directly and does not have to go through the BDE.
Thanks,
Mike
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
First, you should never use 'root' for anything other than administrative purposes on MySQL.  'root' has permissions on ALL databases to do ALL things... including deleting everything.

So did you install the 64-bit version of MySQL ODBC Connector on the 64-bit machine?  I don't know what "DBExpress  Data Explorer" is but I do know that you have to have a MySQL connector to work with MySQL databases.  You might want to read this page: http://stackoverflow.com/questions/5765424/how-to-access-databases-from-within-delphi-xe-professional-ide

Frankly, it would have been simpler to create an appropriate user on the other database.  Unless you're using 'root' there too in which case you should not create a 'root' user with external access.
0
 

Author Comment

by:miker454
Comment Utility
Hi Dave appreciate all your advice. The problem was finally solved when I downloaded the libmysql.dll and put it delphi program directory. I followed the advice in this article http://wiltonsoftware.com/posts/view/getting-embarcadero-dbexpress-mysql-working-dbx-error-driver-not-initialized . It pretty much solved the problem. Appreciate all your great advice.

Thanks,
Mike
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Good find, glad you got it working.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now