Cannot Connect to Mysql Database From delpi Xe5 TSqlConnection - mysql

I am trying to connect to MySQL database using Delphi Xe5 and fire monkey mobile application.
I am using an TSQLConnection to connect to the database but i get an error 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.
I have read the below articles of which none had a solution that worked.
Articles:
DBX Error: Driver could not be properly initialised
http://wiltonsoftware.com/posts/view/getting-embarcadero-dbexpress-mysql-working-dbx-error-driver-not-initialized
None of their solutions seem to work, i use delphi xe5 on Windows 64x.
I have tried downloading the zip file libmysql.dll and coppied into the following paths mentioned but to no avail.
C:\Users\Public\Documents\RAD Studio\12.0\Bpl
C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\bin
Can anybody please assist me in understanding why i am not able to connect to my MySQL database?

Your error message
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 the standard generic one from DBX and just seems to mean "something went wrong somewhere". Error-reporting doesn't seem to be DBX's strong point; a couple of times recently I've had that error when the problem turned out to be quite different than it might lead you to expect. What's annoying about it is that I only found out because I happened to have "Break on exception" turned on in the IDE and could see that the initial exception came with quite different and more revealing info, but the DBX driver seems to re-raise with that text entirely replaced by its generic, info-free version, at least in the circumstances I ran into.
AS you've subsequently found out, a FireDAC connection may succeed in connecting where a DBX one fails, and even where it fails, its error messages are more specific than DBX's. It's a shame because I find FD more fidly to set up (like I always forget its SqlWait component and it doesn't tell me that I have until r/time). So, I'm not suggesting anyone should switch to FireDAC if they've already got DBX working on a given database, just that FD can be a useful diagnostic tool.

Related

Due to Zone.js in Angular Universal server rendering stops working. How to fix?

When in my requests for data I return simple JSON without connection to database the server rendering in Angular Universal works fine.
However I have found that requests to MySQL database is not going if I don't have a proper version of Zone.js.
I had the following error:
TypeError: Cannot read property 'on' of undefined
at Protocol._enqueue (/Applications/MAMP/htdocs/Angular2/myproject/node_modules/mysql/lib/protocol/Protocol.js:152:5)
...
Also I payed attention that I had a warning:
angular2-universal#2.1.0-rc.1 requires a peer of zone.js#~0.6.21 but none was installed.
So I installed proper Zone.js:
npm install zone.js#0.6.21
and I started receiving data from MySQL.
BUT! At this point server rendering stops working! I only see:
<!--template bindings={}-->
in HTML-template.
I moved back to return a JSON without connection to MySQL and have found that even at this case server rendering is not working.
So I have played a little with this and have found that if I use command:
npm install zone.js
then server rendering works properly when I return JSON without connection to database, but if I try to connect to MySQL then original error occurs.
So now I have either working server rendering or connection to MySQL without server rendering. Not server rendering and working connection to database.
If anyone knows what should be done I'll appreciate the help. Thank you.
I have found the solution. In my case the issue was resolved by the command:
npm install zone.js#latest
Now I can do the requests to MySQL and also I have a server rendering and can see all the data in my HTML-template.

How to connect Qt C++ program to an online MySQL database through ODBC (without MySQL Qt Driver compiled)

I was having the following problem that I resolved casually doing lot of attempts:
I need to connect my Qt application to an online mysql database, so I tried lot of times to connect my program to my database, but things didn't works.
At first I had problems to compile MySql driver for Qt, I followed every guide and topic on the web about that but I got always error, so I decided to use ODBC that it's ready for work without any compilation.
So I followed lot of guides and topics about the connection to MySQL through ODBC in Qt (including this: How to connect to a MySQL database through ODBC from Qt application?) but I got always errors also this time. The official documentation of Qt about this topic lacks and isn't updated but I resolved, with lot of attempts and lot of luck so this is the guide on how to connect Qt application to MySQL online database without compile any driver, let's start:
Follow this video: https://youtu.be/K3GZidOwGmM (download ODBC and configure your database as shown)
Create/Open your Qt project
Add to the .pro file the following line: QT += sql
Write the following code (obviously you have to change the hostname, username, ecc.. my parameters are only an example):
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC3", "Database"); // VERY IMPORTANT INSERT QODBC3 AND NOT QODBC
db.setHostName(something.yourhost.com);
db.setUserName(myusername);
db.setDatabaseName(mydatabasename);
db.setPassword(mypassword);
if(db.open()){qDebug()<<"Database opened!";}
else{qDebug() << db.lastError().text();}
If you followed all steps this should work
I spent lot of hours to unterstand how to do this cause to official lack documentation (that doen't work) and cause to lot of versions of Qt..
So i hope this little guide might help all the people that have problems about this topic :)

DB2 Connect issue using Native OLE DB\MS OLEDB Provider for DB2

I downloaded and installed the driver setup file, DB2OLEDB.exe, from here:
http://download.microsoft.com/mwg-internal/de5fs23hu73ds/progress?id=HYLbKUfGNl
Using the connection string that worked on another PC, I tried to create a Connection Object in an SSIS package. When I tested the connection I got this error:
Test connection failed because of an error in initializing provider. A TCPIP socket error has occurred (10057): A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
Any suggestions on what the cause of this error is and how I might resolve this issue?
By the way, when I use the DB2 Configuration set up utility and test a connection from within that, I am able to successfully connect.
What other info can I provide to help you answer this question?
Thank you
Could this be related to a blocked port?
If you follow all the steps illustrated here: http://www.bidn.com/blogs/PatrickLeBlanc/ssis/700/connecting-to-db2-using-ssis do you still get the same result?
Maybe a silly question, did you restart the computer after the installation?
Are you an admin user on one machine and not on the other?
You could try to verify the port connectivity with a quick telnet command:
telnet your-db-host your-db-listening-port
If it connects, that one is off the list.
Doing some research I've found two possible fixes.
The first link suggests calling BeginReceive after the EndAccept logic is complete. Are you using script code, or just using the GUI without any scripting?
TCP async sockets throwing 10057
The second link points to drivers / software on the PC. It could be that you are missing a windows update or have faulty hardware / drivers.
I think this is less likely the case since you could connect to a different machine with the same connection string(?). Can you verify this is a valid statement?
http://social.msdn.microsoft.com/Forums/en-US/1bc3df95-c86d-4d25-aa20-30f61ed00c63/odd-socket-errors
If you could show the connection strings used for both the working and non working, and give a little more detail about The "Other PC" in comparison to the non-working PC... that would be helpful =]
If neither of the posts I've linked are the solution, this specific Google search has proven to yield some seemingly helpful results
"socket" "10057" "no address was supplied."

Yii doesn't find PDO MySQL driver

The yii requirements page says PDO extension + the mysql driver works, phpinfo() says that PDO and the MySQL driver is installed, I have configured the 'db' component in the main config file for my project generated with yiic webapp, checked and double checked that the settings are correct (and yes, I am using mysql).
I have made a new migration script in /[mywebapp]/protected/migrations and now I'm trying to run the ./protected/yiic migrate command, but i just get an exception:
exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver'
I have no idea what is wrong. I have been googling for 2 hours now and i find a lot of other users experiencing the same problems, but usually they are missing the drivers or something obvious. Is there anything i'm completely overlooking?
Despite the real answer being in the comments for this question, I am answering it here so that it appears as an answer. Yiic.php migrate uses the configuration stored in console.php. You need to set your database connection in there to use yiic.

Symfony2 Doctrine2 MS SQL Server connection on WHM/CPanel

SEE UPDATE BELOW:
I'm using Symfony2/Doctrine2 on CPanel and I need to make a connection to a MS SQL Server database. I keep getting an error saying
could not find driver
I've tried to install FreeTDS on WHM/CPanel following these instructions:
http://forums.cpanel.net/f5/definitive-freetds-installation-instuctions-88561.html
I also added an additional option to the PHP compilation (all_php5) so it looks like this:
--with-mssql=/usr/local/freetds --with-pdo-dblib=/usr/local/freetds
I then also added an entry to my php.ini file (/usr/local/lib/php.ini) that says:
extension= "mssql.so"
I rebuilt Apache/PHP after making all these changes but I still get the error saying the driver cannot be found. Anybody have this setup and know what I'm missing?
UPDATE:
So, instead of compiling FreeTDS, I found some packages through yum which I installed. I did, however, compile .so files for both mssql.so and pdo_dblib.so. They are now both referenced in my php.ini that I know is getting loaded. I can successfully use the mssql_* functions but PDO is still not working for me. I still get the the "could not find driver" error. I no longer have an all_php5 file since I don't think I need it anymore since I just compiled the .so files. Is this correct? What else can I do to get PDO working? Here is a screenshot of my phpinfo() page: