Can i use Cakephp 2 with mysql without using PDO? - mysql

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

Related

How do I configure IntelliJ IDEA to use clear-text password authentication for a MySQL data source?

I've tried a few different ways of defining my MySQL database connection in IntelliJ, but can't seem to connect.
Requirements:
Uses an SSH proxy server
Needs the password sent in clear text.
My understanding is that the MySQL driver should have a built in plugin for this, called mysql_clear_password, and that I should be able to enable it on the Advanced tab of the database configuration by declaring its classname (com.mysql.jdbc.authentication.MysqlClearPasswordPlugin) and/or setting the LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN variable to 1, Y or y.
I can't seem to get it to work. Can someone provide guidance on the correct way to do this in the IDE?
One needs to specify additional JDBC parameter authenticationPlugins with value mysql_clear_password.
Also, see https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html

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.

Cannot connect Delphi App to mySQL database

I have installed a local server Xampp, which is running mySQL database in Windows. I created a Database on it with one table. The thing is I cannot get a connection to the database when I use the dbExpress TSQLConnection component. When I set the properties as follows:
ConnectionName = MYSQLConnection
Driver = MySQL
Database = databaseName
HostName = localhost
password =
UserName = root
When I change the connected property to true, I get the following error:
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
I have tried making a connection to the database using the Data Explorer, but I still get the above error. I do not know what I'm missing or doing wrong.
Im using Delphi-XE2.
with mySQL on the server: MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $.
I have also tried using an ADO connection, but I do not know how to set the connection string.
I'm still a noob and just want to learn how to make a connection to a mySQL database running on a web server. I cannot afford to buy any components.
Try this!
Did some google Fu - and stumpled upon this link : http://wiltonsoftware.com/posts/view/getting-embarcadero-dbexpress-mysql-working-dbx-error-driver-not-initialized
That seems to fit your needs.
My previous answer was no help .. hope the new one is better.
Old answer:
Make sure you have Data.DBXMySQL in your uses clause.
OK. I'll try a different approach.
Is it working if you setup the connection in the DataExplorer?
If not - then it's not a problem with the uses clause.
(and you obviously have tried that - sry . must be tired :-))
Otherwise a unit could be like this.
unit Unit1;
interface
uses // <-- Uses normally goes right after interface .... (you probably already have one)
Data.DBXMySql;
implementation
end.

Can't connect to database

Actually I'm having more than one problem...but all of it has to do with connecting or working with the MySQL database...First you can see one of the errors on my website and no matter what you choose it seems to just say it can't connect to the database...I've configured a configure.php file to allow files to connect to the MySQL database...see the website here:
http://netsurfer123.byethost11.com/index.php
Then when I try to log-in to the Admin area of my MySQL database it just says:
phpMyAdmin - Error
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
Please let me know what I can do to correct these errors...and thanks very much in advanced for any helpful response/s.
First you need to check if the MySQL server is actually running. Use a command such as
/etc/rc.d/init.d/mysqld status
Or similar for your system if possible.
Did you check the web server log file? Does it contain errors as indicated by phpMyAdmin?
Your site is simply unable to connect to the database to which it's trying to connect. This could be for any number of potential reasons:
Is the database running?
Is the database accessible by that machine? (Maybe there's a firewall in between the two servers, if they're separated?)
If the database is on that same machine, are you connecting to it properly? (Maybe it allows only certain connection methods, such as a socket vs. the loopback address?)
Is your connection string correct? Maybe the login is failing?
Check your PHP logs, your Apache logs, your MySQL logs. One of them is complaining about something and it's probably trying to tell you what.

Delphi and mysql - Unable to connent to server..maybe custom connection reqd

I am coding an application for my company wherein i want to parse the results of a mysql query and display them in my application but i am facing a problem conecting to the database.
the ip address of the server is : 172.30.192.20
and before i can ping it i have to add route on my pc something like this
route add 172.30.192.0 mask 255.255.255.0 172.30.192.56
where 172.30.192.56 is the gateway
Now whenever i try to connect 172.30.192.20 which is where the sql server is running my appplication instead connects to 172.30.192.56
i am coding the application in delphi and have used TmySQL
After this didnt workout i tried an application called SQLwave. I just entered the server ip address and was able to connect to the database without any problems. it seems sqlwave uses mydac which is why even i tried using it but using the default connection options and setting i was still not able to connect. it seems sqlwave uses a custom connection using mydac
i just want to know whats going wrong with my connection
I tend to use the ADO Components. Here's a small (simple) example you may want to try...
Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;
Above is a Connection String, using the MySQL ODBC 5.1 driver (available on the MySQL website if you don't already have it). Modify this to reflect your server address, database name, username and password. Paste this into the "ConnectionString" property of a TADOQuery.
Set this ADOQuery object's SQL text to something like
SELECT * FROM mytable
Where "mytable" is the name of an existing table in your database.
Now change the ADOQuery object's Active property to True.... see what happens.
As Mason suggested, you may simply be experiencing a connectivity issue, still you never know, my method may come in handy!
Good luck!