views:

180

answers:

5

I need my application to connect to my web server's MySQL database, what is the best option for this. Perfered Data aware Component.

I tried zeos 7, but I keep getting the error: SQL error: Client does not support authentication protocol requested by server; consider upgrading MySQL client and have not been able to fix it.

Thanks

-Brad

+1  A: 

Not sure if it's the best but I've used ADO components (TADOQuery, TADOConnection... Look in the dbGo palette) with success in many Delphi projects in the past to connect to MySQL. It's "free" as it's already bundled with Delphi.

On a side note, your Web host must allow "foreign" connections (not just through "localhost") to their MySQL server.

There is also MicroOLAP MySQL Delphi Direct Access Components which is under 300 US$.

AlexV
+5  A: 

@Brad the ZEOS components are an excellent alternative for connect to MySQL, you have that error because you are using an older version of MySQL client. MySql 4.1 introduces a new password hashing algorithm, for fix this issue you have 2 options.

1) Change your MySQL client to use a 4.1.1 or newer client library.

2) use the the OLD_PASSWORD function

you must run this script in your mysql server.

SET PASSWORD FOR 'user' = OLD_PASSWORD('password');
FLUSH PRIVILEGES;

check this link for more info

Password Hashing in MySQL

RRUZ
Where do I get the new client library? I've downloaded myswl-connector, etc.. didn't work.
Brad
check this link http://dev.mysql.com/get/Downloads/Connector-PHP/php_5.2.0_mysqli_5.0.27-win32.zip/from/pick#mirrors the library is called libmysql.dll
RRUZ
got zeos to work with this. Thanks
Brad
+1  A: 

I would recommend MyDac from Devart ( previously known as Core Lab ).

Also check out their UniDac solution for multiple databases.

ErvinS
+1  A: 

I assume from your message tags that you're using Delphi 2009. DbExpress has come a long way and comes with Delphi. There's a lot of support for it on the web these days. If you're not using Delphi 2009, DbX is available since version 6.

I think the Delphi 2009 version of DbX supports MySQL 5.0. If not, you need an updated DbX driver. You can get an open source driver here.

http://www.justsoftwaresolutions.co.uk/delphi/dbexpress_and_mysql_5.html

Phil Gilmore
+4  A: 

Try AnyDAC, it offers great support for MySQL, among other supported DBMS's. The main features are:

  • High speed.
  • Normal and Embedded servers.
  • SSL connections.
  • Full range of data types, including ENUM, SET.
  • UTF8 and ANSI character encodings.
  • AUTO_INCREMENT columns.
  • Full support for MySQL 5 stored procedures.
  • Batch commands with multiple result sets.
  • Query execution aborting.
da-soft