Greg's Blog

helping me remember what I figure out

Configuring MyODBC on NT

| Comments

This is effectively part II of configuring MySQL for NT. With the help of this document you will be able to access your MySQL database server from other Windows applications (e.g. Cold Fusion). Right so let’s get started. We shall begin with installing MyODBC (a copy of which can be obtained from here http://www.mysql.com/downloads/api-myodbc.html). Installing MyODBC is straightforward. Unzip the downloaded file and click on the setup.exe file and simply follow the installation prompts. For starters just keep accepting the default settings if you are unsure of any options. OK, now we are ready to add a MySQL datasource. You have to do this through ODBC datasources in the Control Panel. Please note: if you were planning on using the Cold Fusion Administrator, you can’t. You have to go through the Control Panel to initially configure the datasource. Once setup you can modify your MySQL datasources through the Cold Fusion Administrator. So go ahead and fire up your ODBC manager. Once open, go to the the system DNS tab and select Add…. From the list of available drivers select MySQL and click Finish. This should fire up a dialogue with a whole bunch of fields. Listed below is a sample entry: [code]Windows DNS name: mydsn MySQL host (name or ip): 127.0.0.1 MySQL database name: mydatabase User: myusername Password: mypassword [/code] Things to bear in mind are: from my personal experience, I found that it’s best to keep windows DSN and database name in lower case. Specifying the IP address works, I have had problems using the host name setting. As for the username and password, make sure that you use those properties that you set to the database you created. I.e. if you don’t require a logon to connect to that database, then leave the fields blank. Else enter the username and password assigned to that database (the default root account will work well, but is contentious for security reasons). Well we are done you should know have configured your system to connect to a MySQL database via ODBC.