Project 1 - 2 Download and Install MyODBC on Windows


Project 1 “2 Download and Install MyODBC on Windows

In this project, you will complete your setup on a Windows computer by downloading and installing MyODBC, which allows you to access databases from a Windows computer. We use MyODBC in Module 7.

Step by Step

  1. Open a web browser and go to http://www.mysql.com/downloads/api-myodbc-3.51.html.

  2. Scroll down to Windows downloads and click Pick a mirror at the right end of the Driver Installer line.

  3. Choose a mirror location near you and click its link.

  4. Select to save MyODBC-3.51.06.exe into My Downloads or another folder of your choice.

  5. Close your browser and open Windows Explorer to My Downloads, or whatever folder you chose to use. Double-click MyODBC-3.51.06.exe.

  6. The installer wizard will open, showing the MyODBC Welcome screen, which is shown next .

  7. Click the Next button. The ReadMe screen opens.

  8. Click the Next button. The Start Installation screen opens. It says to choose Next to continue or use the Back button to reenter installation information, but your memory hasn t fooled you ”if you click the Back button, there is no place to enter any such information.

  9. Click the Next button. The installation progress bars will show fleetingly, and then the Finished window appears.

  10. Click the Finish button.

  11. To check the MyODBC installation, close WinMySQLAdmin (right-click, choose Win9X or WinNT, and then choose Shutdown this Tool).

  12. Open WinMySQLAdmin, either by using the shortcut you placed earlier on your desktop or the one at Start Programs Startup WinMySQLAdmin if you used the Create ShortCut on Start Menu button on the my.ini tab. If you haven t set up either of these options, locate winmysqladmin.exe in the C:\mysql folder and double-click it.

  13. Once WinMySQLAdmin is open again, check the MyODBC window in the Environment tab. It will still say Not Found, as it did in Figure 1-1 because you have not set up any ODBC connections yet, but it will now list information about the ODBC driver and its .dll locations.

Project Summary

You now have both MySQL and MyODBC drivers installed on your Windows computer. MyODBC drivers allow a variety of programs to connect and interact with MySQL. You will learn more about MyODBC in Module 7, which covers GUIs and other Windows- related data-handling options.

Ask the Expert

Why might I change the default settings in MySQL?

The two most common reasons for changing defaults are these:

  • You see a performance decrease in the database s operation.

  • You want to do something that requires a lot of resources.

If you notice a decrease in performance, it can often be solved by changed the amount of RAM specified in the my.cnf or my.ini file from the default setting of 8MB. This usually happens after the database has been in place for a while and is growing either in size or number of users. In that case, the change to the setting would be permanent. Some changes can be done temporarily, though. For instance, if you needed to insert a few million rows into your database, you could change the my.ini file settings to make doing this one thing easier. Then, when you are finished with the insertion, you could return the settings to the way they were for normal operation.

When should I change the default settings in MySQL?

The important thing is to realize that at the beginner s level, you probably don t need to change them at all. They are certainly adequate to accomplish the projects in this book. However, later on, you may need to change them. Then you need to figure out the relative size of your MySQL database. Is it small, medium, large or huge? Even though this is a relative question, you should have a general idea of how big the database currently is or is going to be in the near future. For most noncorporate/commercial use, small or medium will probably be the answer to that question.

MySQL has included, in the download, four files that correspond to the potential size of your database. In other words, they give you four template files to start from: my-small.cnf, my-medium.cnf, my-large.cnf, and my-huge.cnf. Any of these files can replace the my.cnf file in Linux ”the file is located in the /etc directory. In Windows, one of these files would replace the my.ini file. They all represent a starting point from which you can tailor the settings to meet your needs.

What settings should I change?

We will assume that you are using the default table type in MySQL, which is MyISAM. (Module 2 covers table types.) The main setting you need to consider changing in the my.cnf or my.ini file is the key_buffer setting, which controls how much RAM is allocated for the storage of indexes. By default, it is set at 8MB. If you have a computer whose only function is to be your MySQL server, then the sum of the data size in the indexed columns may be greater than 8MB. If this happens, the MySQL application will need to swap to the hard drive to keep up because the buffer size is only 8MB. Swapping slows the performance of your database.

This buffer is the culmination of all of the indexed data (data size) from all of the tables in all of the databases running on the MySQL server. If the server has a total of 2GB of RAM, you may easily have over 1GB of unused RAM that is essentially sitting idle and can be used for this function. Remember that when you set these buffer settings, you are reallocating RAM, and this RAM will not be used for anything else. Once MySQL allocates a portion of RAM for itself, nothing else is allowed to use it, even if it is idle. If your computer is used for other things in unison with MySQL (including the operating system itself), then some RAM needs to be left for those operations.

Another setting you will probably change, once your real database is up and running, is one or more of the logging functions. Module 7 gives a more complete picture of the available settings with which you may alter your MySQL database should practical experience demonstrate the necessity. For now, simply remember that logging functions can be turned on and off in your my.cnf or my.ini file. By setting logs on and specifying their locations in the my.cnf or my.ini file, you save time by having logging taken care of automatically. It also means that you don t need to remember to turn on the logs. The one time you forget will likely be the one time you truly need the information gathered by the logging functions.

What other settings might I eventually change in the my.cnf or my.ini file?

You can tell the MySQL server not to load variables and preallocate resources for table types you are not going to use, such as Berkeley (BDB) tables. You would do this by inserting the setting skip-bdb . If variables are loaded for a table type you are not using, part of your RAM still gets allocated for it, and once again, cannot be used by anything else (even other MySQL functions), which means you are reserving resources that will never get used.

You might also need to change which port the MySQL server uses. You can do this by inserting the setting port=3306, for instance, in the [mysqld] section of the file. You might want to do this for security reasons, or if you are running MySQL through an Internet host, you may be required to do it by your hosting company because of its setup. If you need to change the port number, you do it in the my.cnf or my.ini file. And if you do change the port number, you must remember to change which port the client is attempting to connect through in the client s settings. These topics will be covered in more detail in Module 8.

 



MySQL(c) Essential Skills
MySQL: Essential Skills
ISBN: 0072255137
EAN: 2147483647
Year: 2006
Pages: 109

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net