问题
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:
@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
回答2:
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.
回答3:
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$.
回答4:
I would recommend MyDac from Devart ( previously known as Core Lab ).
Also check out their UniDac solution for multiple databases.
回答5:
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
来源:https://stackoverflow.com/questions/2694412/delphi-mysql-best-data-aware-components-to-use