This section gives a general overview of starting the MySQL server. The following sections provide more specific information for starting the MySQL server from the command line or as a Windows service.
The information here applies primarily if you installed MySQL
using the Noinstall
version, or if you wish
to configure and test MySQL manually rather than with the GUI
tools.
The examples in these sections assume that MySQL is installed
under the default location of C:\Program
Files\MySQL\MySQL Server 5.5
. Adjust the
path names shown in the examples if you have MySQL installed in
a different location.
Clients have two options. They can use TCP/IP, or they can use a named pipe if the server supports named-pipe connections.
MySQL for Windows also supports shared-memory connections if the
server is started with the
--shared-memory
option. Clients
can connect through shared memory by using the
--protocol=MEMORY
option.
For information about which server binary to run, see Section 2.3.8, “Selecting a MySQL Server Type”.
Testing is best done from a command prompt in a console window (or “DOS window”). In 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 make it easier for you to identify and fix any problems.
To start the server, enter this command:
C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --console
For a server that includes InnoDB
support,
you should see the messages similar to those following as it
starts (the path names and sizes may differ):
InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist: InnoDB: a new database to be created! InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200 InnoDB: Database physically writes the file full: wait... InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be created InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280 InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be created InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280 InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be created InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280 InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: creating foreign key constraint system tables InnoDB: foreign key constraint system tables created 011024 10:58:25 InnoDB: Started
When the server finishes its startup sequence, you should see something like this, which indicates that the server is ready to service client connections:
mysqld: ready for connections Version: '5.5.4' socket: '' port: 3306
The server continues 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 server writes diagnostic output to the error log in the data
directory (C:\Program Files\MySQL\MySQL Server
5.5\data
by default). The error log is
the file with the .err
extension.
The accounts that are listed in the MySQL grant tables initially have no passwords. After starting the server, you should set up passwords for them using the instructions in Section 2.11, “Post-Installation Setup and Testing”.
User Comments
If mySql was installed as a service, then you may get an error indicating you already have a mySqld server running if you do the test procedure in this section. You can check the services that are running from your control pannel administrative tools for Computer Management. It will indicate if mySql has already been started.
For really new users:
When your computer has Microsoft Windows Service Pack 2 (SP2), a little window will open asking you to allow or neglect MySQL to connect to Internet (something like this).
Choose the option that allows it.
If you install the MySQL-Administrator(at least as of 1.1.1rc) you can control the service under "service control" (what else...;-)
Furthermore you then get a tool named "MySQL System Tray Monitor" which places an icon in the system tray, indicating the state of the server(service) and allowing some further monitoring and control (at least to shutdown the "service" - here called "instance").
Test procedure.
The following command/result will test your installation.
OS: WinXp
Mysql: mysql-5.0.20-win32
<<< console 1 >>>
<<< to test the installation >>>
<<< open a new console (1) >>>
<<< assumed path C:\mysql\mysql-5.0.20-win32\ >>>
C:\mysql\mysql-5.0.20-win32\bin>mysqld-nt.exe --console
<<< in your console (1) you should see >>>
060416 1:26:36 InnoDB: Started; log sequence number 0 43655
060416 1:26:37 [Note] mysqld-nt.exe: ready for connections.
Version: '5.0.20-nt' socket: '' port: 3306 MySQL Community Edition (GPL)
060416 1:30:38 [Note] mysqld-nt.exe: Normal shutdown
<<< console 2 >>>
<<< to shutdown the running server >>>
<<< open a new console (2) >>>
C:\mysql\mysql-5.0.20-win32\bin>mysqladmin.exe -u root shutdown
<<< in your console (1) you should see >>>
060416 1:30:38 InnoDB: Starting shutdown...
060416 1:30:40 InnoDB: Shutdown completed; log sequence number 0 43655
060416 1:30:40 [Note] mysqld-nt.exe: Shutdown complete
On the essentials install I did on W98, there is no mysqld, but there is a mysqld-nt, which seems to work.
If you installed WAMP and just want to run the MySQL server, from the command line go to C:/..path_to_installation../wamp/bin/mysql/bin/mysql-VERSION-NUMBER/bin/ directory.
From here type mysqld-nt.exe. Then unblock and you should be set.
If trying to run the MySQL Administrator for the first time after getting the server running, if you chose the defaults during installation, you will use:
Server Host: localhost
Port: 3306
Username: root
Password: {the one you typed in during install}
Add your own comment.