Go to the first, previous, next, last section, table of contents.
According to our experience it would just take a few hours to convert a
tool using the mSQL C API to the MySQL C API.
The procedure:
-
Run the shell script msql2mysql on the source. This needs the binary
program replace, which is distributed with MySQL.
-
Compile
-
Fix all compiler errors:
Differences between the MySQL and mSQL C API's.
-
MySQL uses MySQL as a connection type (
mSQL uses an
int).
-
MySQL connect takes a pointer to a MYSQL structure as a parameter. It
is easy to define one globally or use malloc to get one.
-
mysql_connect takes 2 extra parameters. You may set these to NULL,NULL
for default use (user and password).
-
mysql_error takes the MYSQL structure as a parameter. Just add the
parameter to your old msql_error code if you are porting old code.
-
Some incompatibilities exist as a result of MySQL supporting
multiple connections to the server from the same process.
-
MySQL returns an error number and a text for all
errors.
mSQL only returns a text error
Go to the first, previous, next, last section, table of contents.