Page 1 of 1

Mysql in windows

Posted: Sat Jan 19, 2008 11:28 pm
by PresFox
Sorry for starting so many threads, im really enjoying this language

Sofar, ive gotten my program to start the mysql server (and shut it down on close). However, i cannot get a connection to work. This is my current code:

Code: Select all

Global mysqlid = RunProgram(configvalue$(0)+"mysqld-nt.exe") ; mysql path
  StickyWindow(0,1)
  SetGadgetText(#Text_1,"booting mysql....ok")
  Delay(1000)
  SetGadgetText(#Text_1,"Connecting to database")
  InitDatabase()
  dbresult = OpenDatabase(1,"test","root","root")
  Debug(dbresult)
  Debug(DatabaseError())
debug returns this:

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Posted: Sat Jan 19, 2008 11:42 pm
by ABBKlaus
1. Download and install and ODBC-Connector for MySQL : http://dev.mysql.com/downloads/connector/odbc/3.51.html
2. Setup a DSN (Datasourcename) or configure it via API : http://www.purebasicpower.de/downloads/DSN-Test.zip
3. use OpenDatabase() to open the database

Regards Klaus

Posted: Sun Jan 20, 2008 3:13 pm
by PresFox
Thanks for your help

Are there any other ways? Id rather not install those drivers on every system i want my app to run on

Posted: Sun Jan 20, 2008 3:26 pm
by Thalius

Are there any other ways? Id rather not install those drivers on every system i want my app to run on
Well if you want only mysql then you can use Flypes userlib or one of the includes. Keep in mind tho that you then use mysql native functions and not the Databasecommands anymore. THis would require only the mysqlshared dll. :)

Flypes libs:
http://www.purebasic.fr/english/viewtopic.php?t=21862

Thalius

Re: Are there any other ways ...

Posted: Mon Jan 21, 2008 8:13 am
by DTecMeister
If you do go the route of installing them, NSIS is a great tool to simplify the installs.

Posted: Mon Jan 21, 2008 8:46 pm
by superadnim
why MySQL for this type of usage?, I'd go for SQLite3 unless I was forced to use MySQL :lol: