5 stars based on
This section covers the installation of MySQL on platforms where we offer packages using the native packaging format of the respective platform.
The binary distribution contains a setup program that installs everything you need so that you can start the server immediately. Generally speaking, you should use the binary distribution. It's simpler, and you need no additional tools to get MySQL up and running. If you download the distribution via FTP, we recommend the use of an adequate FTP client with a resume feature to avoid corruption of files during the download process.
WinZip or other Windows tool that can read. Enough space on the hard drive to unpack, install, and create the databases in accordance with your requirements. If you are working on a Windows NT,or XP machine, make sure that you have logged in as a user with administrator privileges. If you are doing an upgrade of an earlier MySQL installation, it is necessary to stop the current server.
On Windows NT,or XP machines, if you are running the server as a Windows service, stop it as follows from the command prompt:. If you plan to use a different server after the upgrade for example, if you want to run mysqld-max rather than mysqldremove the existing service:. If you do not install MySQL into the default location, you will need to specify the location whenever you start the server. For example, to install mysql If you are upgrading to MySQL 4.
Then either rename the existing C: This will avoid the loss of your current databases. Start the new server and update the grant tables. 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 will be used every time the server starts, you will find it most convenient to use an option file to specify your MySQL configuration. This is true particularly under the following circumstances:.
The installation or data directory locations are different from the default locations C: You need to tune the server settings. As of MySQL 4. This means you need not configure InnoDB explicitly. You may still do so if you wish, and an option file will be useful in this case, too. 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.
If you want to use a data directory of E: Move the data directory from C: Use a --datadir option to specify the new data directory location each time you start the server.
The Windows directory typically is mysql binary installation on linux something like C: MySQL looks for options first in the my. However, to avoid confusion, it's best if mysql binary installation on linux use only one file. If your PC uses a boot loader where the C: Whichever option file you use, it must be a plain text file. An option file can be created and modified with any text editor, such as the Notepad program.
Note that Windows pathnames are specified in option mysql binary installation on linux using forward slashes rather than backslashes. If you do use backslashes, you must double them. Starting with MySQL 3. Up through the early releases of MySQL 4. We have found that the server with the most generic name mysqld is the one that many users are likely to choose by default.
However, that is also the server that results in the highest memory and CPU use due to the inclusion of full debugging support. The server named mysqld-opt is mysql binary installation on linux better general-use server choice to make instead if you don't need debugging suport and don't want the maximal feature set offered by the -max servers or named pipe support offered by the -nt servers.
To make it less likely that the debugging server would be chosen inadvertantly, some name changes were made from MySQL 4. Thus, the server that includes debugging support indicates that in its name, and the server named mysqld is an efficient default choice. The other servers still have their same names. The resulting servers are named like this:. The name changes were not both instituted at the same time. If you have MySQL mysql binary installation on linux. In this case, you should have have a server mysqld-optwhich you should choose as your default server unless you need maximal features, named pipes, or debugging support.
All of the preceding binaries are optimized for modern Intel processors, but should work on any Intel iclass or higher processor. The mysqld-nt and mysql-max-nt servers support named pipes on NT,and XP. Named pipe use is subject to these conditions:. Starting from MySQL 3. It is now necessary to use this option explicitly because some users have experienced problems shutting down the MySQL server when named pipes were used.
Named pipe connections are allowed only mysql binary installation on linux the mysqld-nt or mysqld-max-nt servers, and only if the server is run on a version of Windows that supports named pipes NT,XP. Most of the examples in the following sections use mysqld as the server name. If you choose to use a different server, such as mysqld-optmake the appropriate substitutions in the commands that are shown in the examples.
One good reason to choose a different server is that because mysqld contains full debugging support, it uses more memory and runs slower than the other Windows servers. This will allow any machine on your network to connect to your MySQL server. You can get the newest Winsock from http: Windows 98 has the new Winsock 2 library, so it is unnecessary to update the library. This section gives a general overview of starting the MySQL server. The following sections provide more specific information for particular versions of Windows.
Mysql binary installation on linux the pathnames shown in the examples if you have MySQL installed in a different location. This way you can have the server display status messages in the window where they are easy to see. If something is wrong with your configuration, these messages will make it easier for you to identify and fix any problems.
For servers that include InnoDB support, you should see the following messages as the server starts:. When mysql binary installation on linux server finishes its startup sequence, you should see something like this, which indicates that the server mysql binary installation on linux ready to service client connections:. The server will continue to write to the console any further diagnostic output it produces. You can open a new console window in which to run client programs.
If you omit the --console option, the mysql binary installation on linux writes diagnostic output to the error log in the data directory C: The error log is the file with the. The accounts that are listed in the MySQL grant tables initially have no passwords. The MySQL server can be started manually from the command line. This can be done on any version of Windows. On non-NT versions of Windows, this will start mysqld in the background.
That is, after the server starts, you should see another command prompt. If you start the server this way on Windows NT,or XP, the server mysql binary installation on linux run in the foreground and no command prompt will appear until the server exits. Because of this, you should open another console window to run client programs while the server is running. This invokes the MySQL administrative utility mysqladmin to connect to the server and tell it to shut down.
The command connects as rootwhich is the default administrative account in the MySQL grant system. If mysqld doesn't start, check the error log to see whether the server wrote any messages there to indicate the cause of the problem.
The error log is located in the C: It is the file with a suffix of. You can also try to start the server as mysqld --console ; in this case, you may get some useful information on the screen that may help solve the problem.
The last option is to start mysqld with --standalone --debug. In this case, mysqld will write a log file C: Use mysqld --help to display all the options that mysqld understands!
A server installed as a service can also be controlled from the command line using NET commands, or with the graphical Services utility. It is advisable to close the Services utility while performing server installation or removal operations from this command line. This prevents some odd errors. Before installing MySQL as a Windows service, you should first stop the current server if it is running by using the following command:.
If you have problems installing mysqld as a service using just the server name, try installing it using its full pathname:. The rules that determine the service name and option files the server uses are as follows:. If you specify no service name, the server uses the default service name of MySQL and the server reads options from the [mysqld] group in the standard option files.
If you specify a service name after the --install option, the server ignores the [mysqld] option group and instead reads options from mysql binary installation on linux group that has the same name as the service. The server reads options from the standard option files. If you specify a --defaults-file option after the service name, the server ignores the standard option files and reads options only from the [mysqld] group of the named file.
Prior to MySQL mysql binary installation on linux.