We will assume in this discussion that you have installed MySQL in the default location on your operating system. If you have installed it elsewhere, the basic directory structure will still be the same, but the base locations will be different. If your system came with a vendor-supplied version of MySQL, you may have a different structure. For example, if you have Red Hat 9, you will find that it has reorganized the files to fit into its overall filing system. If you have installed MySQL from a MySQL-supplied RPM, the files should be in the locations documented here. You should also note that the directory structure will vary slightly depending on which optional items you installed and whether you installed a binary distribution or a source distribution. In this book, we assume that you installed a binary distribution as recommended in Chapter 1, "Installing MySQL." If you have a Unix-like operating system, the default location for the MySQL files is in /usr/local/mysql. If you have Windows, the default location is C:\mysql. At that location, you will find a set of directories, including the following ( assuming that you installed from a binary distribution):
There are also a couple of other directories that the average user will rarely go into: include (containing header files), lib (containing libraries used by MySQL), share (containing MySQL's error messages), and examples (only in Windows, containing examples of using the libmysql DLL). You may need to know where these directories are if you install other software (such as PHP) that links to MySQL, but you are unlikely to interact with them directly. |