Usted puede mplear Free Pascal para acceder a un servidor de Bases de Datos MySQL desde Linux. (Si necesita información adicional sobre MySQL, visite su página Web)
Interfacing is very easy, all you need to do is compile some units, and use these units in your program. You need to specify the place of the MySQL client Library (libmysqlclient when compiling, and that is it. the provided units take care of the rest.
Provided units and programs
The packages provides 3 units, of which normally only the first is needed:
- mysql the main mysql unit.
- mysql version provides access to the version number of the mysql library.
- mysql com contains some internal routines of mysql, should normally not be used unless you want access to some internal types.
The same units exist for versions 3.22 and 4.00 of mysql as well, in subdirecties. The default supported version is version 3.23.
The test program is called testdb.
The mysql interface is distributed with the Free Pascal packages, and come with the compiler distribution: Normally no action should be taken to work with MySQL.
In case you want to modify and compile the units yourself, the mysql sources are in the packages directory: packages/mysql
This directory contains the units, a test program and a makefile. cd to the directory and type
This should compile the units. If compilation was succesful, you can install with
You can then test the program by running
- Run a script to create a table in a database, and fill it with some data. (the mysql program should be in your PATH for this) . By default, the used database is testdb.
- Run the testprogram testdb
- Run a shell script again to remove the created table.
You will see a lot of messages on your screen, giving you feedback and results. If something went wrong, make will inform you of this.
The interface to mysql is a pure translation of the mysql C header files. This means that the used functions are rather un-pascalish. It would be great to have an OOP interface for it, A la Delphi. This interface is being worked on.
Go to back Packages List