Recent

Author Topic: How to create new MySQL databases/tables from a Lazarus application?  (Read 8095 times)

Kyjan

  • New Member
  • *
  • Posts: 41
Hi everyone,

i tried to google, and read many forums on this site, but i was unable to found the solution. My problem is that I'm writing an installer for my program which uses a mysql database. I don't want - and maybe the users don't want, too - configure the mysql database through phpmyadmin. So I tried to figure it out how can I create the mysql database from the installer app. Please help, this is the final step and after i can give the program to the customers.

Thanks,
Kyjan

Kyjan

  • New Member
  • *
  • Posts: 41
Re: How to create new MySQL databases/tables from a Lazarus application?
« Reply #1 on: September 20, 2009, 09:19:22 am »
Okay, I found the solution:

Code: [Select]
SQLQuery.SQL.Text:='create database `dbname`';
SQLQuery.ExecSQL;

This is all :)

Kyjan

Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: How to create new MySQL databases/tables from a Lazarus application?
« Reply #2 on: October 03, 2009, 11:52:19 pm »
Or: TmysqlConnection.CreateDB(..)

 

TinyPortal © 2005-2018