Mysql in windows

Just starting out? Need help? Post your questions and find answers here.
PresFox
User
User
Posts: 33
Joined: Sat Jan 19, 2008 9:30 am

Mysql in windows

Post 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
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post 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
PresFox
User
User
Posts: 33
Joined: Sat Jan 19, 2008 9:30 am

Post 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
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post 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
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
DTecMeister
User
User
Posts: 42
Joined: Sat Mar 04, 2006 5:19 pm
Location: Rome, NY

Re: Are there any other ways ...

Post by DTecMeister »

If you do go the route of installing them, NSIS is a great tool to simplify the installs.
Where are the masses?
superadnim
Enthusiast
Enthusiast
Posts: 480
Joined: Thu Jul 27, 2006 4:06 am

Post by superadnim »

why MySQL for this type of usage?, I'd go for SQLite3 unless I was forced to use MySQL :lol:
Post Reply