Installing MySQL on Windows

You can run MySQL under Windows 95, Windows 98, or Windows NT. To do so, you must have TCP/IP support installed, and your Winsock software must be at least version 2.

You can install two kinds of MySQL software under Windows:

  • Standalone programs, such as those you install for UNIX (the mysqld server and client programs such as mysql and mysqladmin).

  • MyODBC, the MySQL driver for ODBC that allows other programs (such as Access) to communicate with MySQL servers.

The Windows distributions are all available from the MySQL Web site as zip files. To unpack such a file, just double-click it. If that does not work, use a program such as Winzip or pkunzip to unpack files. The primary distributions include the following:

  • mysqlwin-version.zip

    The full distribution (server and clients).

  • winclients-version.zip

    Client-only software (mysql, mysqladmin, mysqldump, and so forth). You can use this if you don't want to run the server under Windows.

  • myodbc-version-win95.zip
    myodbc-version-nt.zip
    

    MyODBC support for Windows 95 (or Windows 98), and for Windows NT.

  • mysqlclient-version-cygwin-b20.tar.gz

    MySQL clients compiled with the Cygnus toolkit. This includes mysqlc, a version of the mysql client that has command-line history editing capability. If you install this, you'll need to copy the library file cygwinb19.dll from C:mysqllib to your Windows system directory.

Installing a Client-Only or Client/Server Distribution

If you have the winclients-version.zip distribution containing client software only, unpack it to produce a mysql folder. Move this folder to C:.

If you have the mysqlwin-version.zip distribution containing the server and the clients, unpack it first. In the resulting folder, run the Setup program to install MySQL in C:mysql.

Choose from the following servers:

ServerDescription
mysqldStandard server
mysqld-optServer optimized for Pentium processors
mysqld-ntServer that can be installed as a service under Windows NT

You can run any of the servers under NT, but the last one may only be run under NT.

To run mysqld or mysqld-opt, start the server as follows:

C:> C:mysqlinmysqld
C:> C:mysqlinmysqld-opt
						

To shut down the server, use the mysqladmin utility:

C:> C:mysqlinmysqladmin -u root shutdown
						

Under Windows NT, you can run the mysqld-nt server as a service:

C:> C:mysqlinmysqld-nt --install
						

If you start mysqld-nt this way, you can specify other options by putting them in the option file C:my.cnf. They cannot be specified on the command line.Whenmysqld-nt is running as a service, you can start or stop it using the following commands:

C:> net start mysql
C:> net stop mysql
						

You can also use the Services Control Manager utility found in the Control Panel folder to start or stop the server, or you can use the mysqladmin utility to stop the server from the command line:

C:> C:mysqlinmysqladmin -u root shutdown
						

To run mysqld-nt as a standalone program, invoke it like this:

C:> C:mysqlinmysqld-nt --standalone
						

In this case, you can specify other options on the command line after the --standalone option if you want. To shut down the server, use mysqladmin.

If you have problems getting the server to run, check the Windows notes in the chapter "Installing MySQL" in the MySQL Reference Manual.

The default installation allows the MySQL root user to connect without a password. For instructions on establishing a password, see Chapter 11.

Installing MyODBC

Unpack the appropriate distribution (there is one for Windows 95 or 98, and another for Windows NT). In the resulting folder, run the Setup program to install the MySQL ODBC driver. An ODBC control panel is also installed that you can use to configure the driver.

If you encounter an error, such as "Problems while copying MFC30.DLL," while installing MyODBC, then MFC30.DLL is being used by some application. In this case, try restarting Windows in safe mode and run the Setup program again.

When you run the ODBC control panel, you'll see a window that allows you to set up a data source name (DSN). Click the User DSN tab and then click the Add button to bring up a window that lists the available data source drivers. Select the MySQL driver from the list and click the Finish button. You'll see a window that allows you to enter connection parameters for the data source. Fill in parameters that are appropriate for the connection that you want to establish and then click the OK button. For example, to set up a data source for the samp_db database using the server and user account that I use throughout most of this book, I'd fill in the fields as follows:

Field NameField Value
Windows DSN name:samp_db
MySQL host (name or IP):pit-viper.snake.net
MySQL database name:samp_db
User:paul
Password:secret

Now you should be able to use ODBC-aware programs to access MySQL databases.

Installing Perl DBI Support

The easiest thing to do is to get the ActiveState Perl distribution from the ActiveState Web site (http://www.activestate.com/) and install it. Then fetch and install the additional Perl modules that you need. The ppm (Perl Package Manager) program is used for this. To find out what modules are already installed, use this command:

C:> C:perlinppm info
						

Then install the modules you need using the appropriate commands from the following list. It's likely that CGI.pm will already be installed, but you'll probably need to install the DBI-related packages.

C:> C:perlinppm install Data-Dumper
C:> C:perlinppm install DBI
C:> C:perlinppm install DBD-mysql
C:> C:perlinppm install CGI
						

Installing PHP and Apache

Under Windows, PHP is a separate executable, and MySQL support is a DLL file. For complete instructions on installing PHP on Windows, the best thing to do is to visit the following Web page:

http://www.umesd.k12.or.us/php/win32install.html

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.111.24