Difference between revisions of "mysql/es"

From Free Pascal wiki
Jump to navigationJump to search
Line 1: Line 1:
 
== Introducción ==
 
== Introducción ==
Usted puede emplear Free Pascal para acceder servidores de Bases de Datos MySQL desde Linux. (Si necesita información adicional sobre MySQL, visite su página [http://www.mysql.com/ Web (en inglés)] o puede leer la página correspondiente de la [http://es.wikipedia.org/wiki/MySQL Wikipedia])
+
Usted puede emplear Free Pascal para acceder servidores de Bases de Datos MySQL desde Linux. (Si necesita información adicional sobre MySQL, visite su página [http://www.mysql.com/ Web (Inglés)] o puede leer la página correspondiente de la [http://es.wikipedia.org/wiki/MySQL Wikipedia (Castellano/Español])
  
 
La forma de realizarlo es muy sencilla, todo lo que necesita hacer es compilar algunas librerias (Units), y emplear esas librerias en su propio programa. También es necesario que indique la ruta donde se encuentra la Librería Cliente para MySQL (''libmysqlclient'') cuando vaya a compilar su programa, y eso es todo. Las librerías enlazadas se encargarán del resto.
 
La forma de realizarlo es muy sencilla, todo lo que necesita hacer es compilar algunas librerias (Units), y emplear esas librerias en su propio programa. También es necesario que indique la ruta donde se encuentra la Librería Cliente para MySQL (''libmysqlclient'') cuando vaya a compilar su programa, y eso es todo. Las librerías enlazadas se encargarán del resto.

Revision as of 16:40, 11 September 2010

Introducción

Usted puede emplear Free Pascal para acceder servidores de Bases de Datos MySQL desde Linux. (Si necesita información adicional sobre MySQL, visite su página Web (Inglés) o puede leer la página correspondiente de la Wikipedia (Castellano/Español)

La forma de realizarlo es muy sencilla, todo lo que necesita hacer es compilar algunas librerias (Units), y emplear esas librerias en su propio programa. También es necesario que indique la ruta donde se encuentra la Librería Cliente para MySQL (libmysqlclient) cuando vaya a compilar su programa, y eso es todo. Las librerías enlazadas se encargarán del resto.

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.

Installation

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

make

This should compile the units. If compilation was succesful, you can install with

make install

You can then test the program by running

make test

This will:

  • 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.

Future plans

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