http://dev.mysql.com/downloads/ 2.3.7. Creating an Option File My Example: my.cnf in c:\ (note that it searches c:\windows first so clear up any old installations) port = 3306 socket = /tmp/mysql.sock
basedir="C:/server/mysql" datadir="C:/server/mysql/data" default-character-set=latin1 sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" max_connections=10 everything else as is from their example of small.ini
If you need to specify startup options when you run the server, you can indicate them on the command line or place them in an option file. For options that are used every time the server starts, you may find it most convenient to use an option file to specify your MySQL configuration. This is particularly true under the following circumstances:
The installation or data directory locations are different from the default locations (C:\Program Files\MySQL\MySQL Server 5.0 and C:\Program Files\MySQL\MySQL Server 5.0\data).
You need to tune the server settings.
When the MySQL server starts on Windows, it looks for options in two files: the my.ini file in the Windows directory, and the C:\my.cnf file. The Windows directory typically is named something like C:\WINDOWS or C:\WINNT. You can determine its exact location from the value of the WINDIR environment variable using the following command:
C:> echo %WINDIR%
MySQL looks for options first in the my.ini file, and then in the my.cnf file. However, to avoid confusion, it's best if you use only one file. If your PC uses a boot loader where C: is not the boot drive, your only option is to use the my.ini file. Whichever option file you use, it must be a plain text file.
You can also make use of the example option files included with your MySQL distribution. Look in your install directory for files such as my-small.ini/cnf, my-medium.cnf, my-large.cnf, and my-huge.cnf, which you can rename and copy to the appropriate location for use as a base configuration file.
An option file can be created and modified with any text editor, such as Notepad. For example, if MySQL is installed in E:\mysql and the data directory is in E:\mydata\data, you can create an option file containing a [mysqld] section to specify values for the basedir and datadir parameters:
[mysqld]
set basedir to your installation path
basedir=E:/mysql
set datadir to the location of your data directory
datadir=E:/mydata/data
Note that Windows pathnames are specified in option files using (forward) slashes rather than backslashes. If you do use backslashes, you must double them:
[mysqld]
set basedir to your installation path
basedir=E:\mysql
set datadir to the location of your data directory
datadir=E:\mydata\data
On Windows, the MySQL installer places the data directory directly under the directory where you install MySQL. If you would like to use a data directory in a different location, you should copy the entire contents of the data directory to the new location. For example, if MySQL is installed in C:\Program Files\MySQL\MySQL Server 5.0, the data directory is by default in C:\Program Files\MySQL\MySQL Server 5.0\data. If you want to use E:\mydata as the data directory instead, you must do two things:
- Move the entire data directory and all of its contents from C:\Program Files\MySQL\MySQL Server 5.0\data to E:\mydata.
- Use a --datadir option to specify the new data directory location each time you start the server.
The following table shows the available servers for Windows in MySQL 5.0: Binary Description mysqld-debug Compiled with full debugging and automatic memory allocation checking, as well as InnoDB and BDB support. mysqld Optimized binary with InnoDB support. mysqld-nt Optimized binary for Windows NT, 2000, and XP with support for named pipes. mysqld-max Optimized binary with InnoDB and BDB support. mysqld-max-nt Like mysqld-max, but compiled with support for named pipes.
All of the preceding binaries are optimized for modern Intel processors, but should work on any Intel i386-class or higher processor.
All Windows MySQL 5.0 servers have support for symbolic linking of database directories.
MySQL supports TCP/IP on all Windows platforms. The mysqld-nt and mysql-max-nt servers support named pipes on Windows NT, 2000, XP, and 2003. However, the default is to use TCP/IP regardless of platform. (Named pipes are slower than TCP/IP in many Windows configurations.)
create a .bat file to start the server (when apache is running!): c:\server\mysql\bin\mysqld.exe --console
(it could be -nt version etc.) If you omit the --console option, the server writes diagnostic output to the error log in the data directory (C:\Program Files\MySQL\MySQL Server 5.0\data by default). The error log is the file with the .err extension.
then start the client (in a DOS command console window) C:> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql" actually you need the mysql -u username -p password
shutdown with this console command: C:> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin" -u root shutdown