Yii doesn't find PDO MySQL driver - mysql

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.

Related

Cannot Connect to Mysql Database From delpi Xe5 TSqlConnection

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.

Can i use Cakephp 2 with mysql without using PDO?

I'm trying to host a cakephp2 application on an old managed server that has pdo_mysql disabled. Politics dictates that I'm unable to rectify this problem, so I'm looking for connection alternatives.
cakephp is producing the following error:
"A Database connection using "Mysql" was missing or unable to connect.
The database server returned this error: Selected driver is not enabled"
Is there a way to connect to the database using the older mysql database extension?
There's no easy way to do it.
If you want to, you could write your own DboSource class, you could reuse the the existing one and use the old-deprecated mysql database extension. (Or if you're lucky you could find one on the internet, but i doubt it)
Then you'll only need to change the DboSource in your settings to use your own class
Hope this helps

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."

getting error "Authentication with old password no longer supported, use 4.1 style passwords." while creating WCF service of hosted MySQL database

I have MySQL database hosted on server. I want to create WCF web service of that database. Actually I want to comsume WCF service in Windows Store App. I am following these articles.
Using an Entity Framework Entity as a Windows Forms Data Source
Making a Connection
But I am getting error Authentication with old password no longer supported, use 4.1 style passwords. Then searched Stack Overflow and got this solution, but it is also not working for me.
Please guide me to solve this issue.
PS : Please don't down vote this question, I have googled and searched in Stack Overflow but didn't get solution :(
UPDATE 1
I have applied command via phpMyAdmin in SQL query textbox. I also followed this Mysql password hashing method old vs new, but getting same error that "you have no SUPER privilege."
I have not managed to solve the problem as the others who have responded, although I tried out everything that has been proposed. In the end it turned out that the server on which stood my DB is not updated phpMyAdmin since version 3.5.5, and is currently being used everywhere version 4.1.14 and it is a problem. The solution is to update your host phpMyAdmin or your own mySQL back to an earlier version in order to continue working on remote DB. You may need this knowledge in order to solve some doubts that have arisen. :)

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: