The world's most popular open source database
On Windows, the data directory and the grant tables do not have to
be created. MySQL Windows distributions include the grant tables
with a set of preinitialized accounts in the
mysql database under the data directory. It is
unnecessary to run the mysql_install_db script
that is used on Unix. Regarding passwords, if you installed MySQL
using the Windows Installation Wizard, you may have already
assigned passwords to the accounts. (See
Using the MySQL Installation Wizard.) Otherwise, use the
password-assignment procedure given in
Section 2.3, “Securing the Initial MySQL Accounts”.
Before setting up passwords, you might want to try running some client programs to make sure that you can connect to the server and that it is operating properly. Make sure that the server is running (see Starting the Server for the First Time), and then issue the following commands to verify that you can retrieve information from the server. The output should be similar to what is shown here:
C:\>C:\mysql\bin\mysqlshow+--------------------+ | Databases | +--------------------+ | information_schema | | mysql | | test | +--------------------+ C:\>C:\mysql\bin\mysqlshow mysqlDatabase: mysql +---------------------------+ | Tables | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | host | | plugin | | proc | | procs_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ C:\>C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM db" mysql+------+-------+------+ | host | db | user | +------+-------+------+ | % | test% | | +------+-------+------+
You may need to specify a different directory from the one shown;
if you used the Windows Installation Wizard, then the default
directory is C:\Program Files\MySQL\MySQL Server
5.1, and the mysql and
mysqlshow client programs are in
C:\Program Files\MySQL\MySQL Server
5.1\bin. See
Using the MySQL Installation Wizard, for more information.
If you have already secured the initial MySQL accounts, you may
need to use the -u and -p
options to supply a user name and password to the
mysqlshow and mysql client
programs; otherwise the programs may fail with an error, or you
may not be able to view all databases. For example, if you have
assigned the password “secretpass” to the MySQL
root account, then you can invoke
mysqlshow and mysql as shown
here:
C:\>C:\mysql\bin\mysqlshow -uroot -psecretpass+--------------------+ | Databases | +--------------------+ | information_schema | | mysql | | test | +--------------------+ C:\>C:\mysql\bin\mysqlshow -uroot -psecretpass mysqlDatabase: mysql +---------------------------+ | Tables | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | host | | plugin | | proc | | procs_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ C:\>C:\mysql\bin\mysql -uroot -psecretpass -e "SELECT Host,Db,User FROM db" mysql+------+-------+------+ | host | db | user | +------+-------+------+ | % | test% | | +------+-------+------+
For more information about these programs, see mysqlshow, and mysql.
If you are running a version of Windows that supports services and you want the MySQL server to run automatically when Windows starts, see Starting MySQL as a Windows Service.

