Page 1 of 1

connect to mysql database using 6.6xx

Posted: 25.06.2007, 11:56
by yonghan
Hi..i want to ask how to connect to a mysql datbase.Also if i want to distribute the application?What must i include in the setup application?Thx a lot.

Posted: 25.06.2007, 13:17
by mdaems
1. How to connect to a mysql database:
Drop a TZconnectioncomponent on a form and set protocol to 'mysql' (or even better mysql-x, where x is the version). Set user, host and password. This can all be done at design time in the property inspector. When active is set to true a connection will be made.
2. To be able to run your application (or make a connection from the IDE) the system must be able to find the libmysql.dll file. (or the libmysqlxx.dll file) When running a standalone exe file just drop the dll next to your executable or in the system path. When running from the IDE the dll must be available in the system path. (ind win32\system32 should be OK on windows systems)
3. When adding to a setup application be carefull with licencing stuff. Mysql is a licenced product, so make sure you are allowed to distribute/package it with your application. Maybe you have to tell your client he should take the dll from his own mysql distribution or you need a mysql OEM licence.

Mark

If i include the mysql?

Posted: 26.06.2007, 13:29
by yonghan
I'll give it a try.Thanks a lot.

Posted: 26.06.2007, 13:38
by yonghan
Sorry,i want to ask again.How to choose a database that i will be using?What file will it be used?Thanks a lot.

Posted: 26.06.2007, 13:58
by mdaems
Set this TZConnection properties:
- Protocol : mysql (or mysql-xx depending on your version, when you choose mysql, mysql-5 protocol will be used)
- Host : the server ip or name (default =empty -> localhost)
- Port : server port number (0=default mysql port)
- Database : the database name in the mysql server.
- User : the database user you connect with
- Password : the password the user needs to connect to the server.

need help again..

Posted: 27.06.2007, 04:57
by yonghan
Hi..i want to ask again.What format of database should i choose? *.myi or which one.Thanks a lot.

Posted: 27.06.2007, 12:12
by mdaems
just the database name. Not a FILEname. How do you connect using the mysql console? First time you use mysql?

Sorry,i've succeded.

Posted: 28.06.2007, 06:45
by yonghan
I've succeeded connect.Sorry if i ask again.When i want to distribute the program,must the dcu's included in the setup?Thanks a lot.

Posted: 28.06.2007, 08:00
by mdaems
No, not at all.

You need your exe and the libmysql file you use.
If you work with runtime libraries you will have to distribute them as well. Zeoslib can also be used this way, but I suppose you're not that an advanced user yet. ;)