This section describes how start the server on Unix and Unix-like systems. (For Windows, see Starting MySQL Server on Microsoft Windows for the First Time.) For some suggested commands that you can use to test whether the server is accessible and working properly, see Section 3.3, “Testing the Server”.
Start the MySQL server like this:
bin/mysqld_safe --user=mysql &
It is important that the MySQL server be run using an unprivileged
root) login account. To ensure this if you
run mysqld_safe as
--user option as
shown. Otherwise, you should execute the program while logged in
mysql, in which case you can omit the
--user option from the
For further instructions for running MySQL as an unprivileged user, see Section 2.5, “How to Run MySQL as a Normal User”.
If the command fails immediately and prints
ended, look for information in the error log (which by
default is the
in the data directory).
If the server is unable to access the data directory it starts or
read the grant tables in the
mysql database, it
writes a message to its error log. Such problems can occur if you
neglected to create the grant tables by initializing the data
directory before proceeding to this step, or if you ran the
command that initializes the data directory without the
--user option. Remove the
data directory and run the command with the
If you have other problems starting the server, see Section 3.2.1, “Troubleshooting Problems Starting the MySQL Server”. For more information about mysqld_safe, see mysqld_safe — MySQL Server Startup Script.
You can set up new accounts using the
bin/mysql_setpermission script if you install
modules. See mysql_setpermission — Interactively Set Permissions in Grant Tables. For Perl
module installation instructions, see
Perl Installation Notes.
If you would like to use mysqlaccess and have
the MySQL distribution in some nonstandard location, you must
change the location where mysqlaccess expects
to find the mysql client. Edit the
bin/mysqlaccess script at approximately line
18. Search for a line that looks like this:
$MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
Change the path to reflect the location where
mysql actually is stored on your system. If you
do not do this, a
Broken pipe error will occur
when you run mysqlaccess.