Newbie Question re: MYSQL lazarus / 16-Databases ---------------------------------------------------------------------- LSemmens · 2014-05-31 13:42 I have a background in dBase and Clipper (last century) and am familiar enough with M$ Access but want to move to a more cross platform environment. I was directed to the Lazarus Project as a suitable alternative to Access for DBMS. I have Loaded MYSQL 5.6 and set up my tables and relevant references in that, as, from my research, it appears that the TDBF extension (terminology?) does not support referential integrity. Am I correct? Now for the question. How do I connect to the database and the underlying tables. I'm guessing that I may need to learn FreePascal too. EDIT: Whooops, my....... I am using MYSQL Workbench 6.1 CE ---------------------------------------------------------------------- mangakissa · 2014-05-31 13:59 Welccome to the Lazarus/FPC Forum. QuoteHow do I connect to the database and the underlying tablesWhy should you. For you it's not important how data is stored on a databaseserver. MySQL uses separated files and indexes while Firebird, Interbase, MS Acces and Oracle uses a single file (repository). Let the databaseserver work for you. If you want data from a user table (SELECT * from users), just call the databaseserver with a query and he is giving a result back. The most important thing is (if you're not working native) using the right client library. ---------------------------------------------------------------------- BigChimp · 2014-05-31 14:38 You're connecting to the database server, not the database file directly(I think that is what mangakissa tried to say). TDBF is for opening dbase/foxpro/visual foxpro files. It has nothing to do with mysql. See these tutorials and more on the wiki: http://wiki.lazarus.freepascal.org/SQLdb_Tutorial1 http://wiki.lazarus.freepascal.org/SQLdb_Tutorial2 http://wiki.lazarus.freepascal.org/SQLdb_Tutorial3 See also http://wiki.lazarus.freepascal.org/mysql#SQLDB which explains you'll have to keep your mysql client library and your connection object in sync; one of the reasons I prefer Firebird or PostgreSQL over mysql... ---------------------------------------------------------------------- LSemmens · 2014-05-31 14:47 Thanks for the quick responses. I am not yet locked into MYSQL, it was also recommended to me as a most suitable database engine. Will firebird or postgreSQL suffer from a size limitation on databases. I hit the 2GB limit in Access early in the piece and had to do some major rework to overcome that, I do not wish to be caught again. Will either of the two mentioned also handle BLOB data. I have a heap of images that, for ease of data storage would be better stored in the database than externally. ---------------------------------------------------------------------- Leledumbo · 2014-05-31 14:55 QuoteI am not yet locked into MYSQL, it was also recommended to me as a most suitable database engine. Will firebird or postgreSQL suffer from a size limitation on databases.If I understood correctly, you've been told in the wrong way. MySQL is not designed to handle HUGE data (except the commercial version, maybe), while PostgreSQL is designed for enterprise use from beginning. Not sure about Firebird, though. QuoteWill either of the two mentioned also handle BLOB data.http://www.postgresql.org/docs/9.3/static/datatype-binary.html http://www.firebirdsql.org/refdocs/langrefupd21-blob.html ---------------------------------------------------------------------- BigChimp · 2014-05-31 14:57 No and both, respectively Firebird advantage: apart from using it as a client/server db, you can use it as an embedded (file based db) just like Access. PostgreSQL advantage: hugely popular alternative to mysql, more well known than Firebird. See also http://wiki.lazarus.freepascal.org/firebird http://wiki.lazarus.freepascal.org/postgresql#SQLDB BTW: You can use e.g. ODBC to get your data out of MS Access (both on Windows and Linux/unix): http://wiki.lazarus.freepascal.org/MS_Access ---------------------------------------------------------------------- exdatis · 2014-06-02 06:24 I suggest, also, Firebird/PostgreSQL See: http://forum.lazarus.freepascal.org/index.php/topic,16947.msg9288 2.html#msg92882 ---------------------------------------------------------------------- LSemmens · 2014-06-03 03:18 Thank you all for your interest, I am now working my way through the various tutorials and links to which you have all pointed. I'm sure I'll have more questions.