The default priviliges is that anybody may create/use the databases
named test or starting with test_. root can do
anyting. See section How does the privilege system work?.
To change the defaults edit the script before running it. If this is
the first time you install MySQL you must run this command. If
you don't do it you will get the error: Can't find file:
'./mysql/host.frm'. This script also starts the mysqld daemon the first
time.
If you want to change things in the grant tables after installing you
should use mysql -u root mysql to connect to the grant tables
as the 'root' user.
Normal start of the MySQL server daemon (not needed the first
time): 'installation_directory'/bin/safe_mysqld --log
It may happen that mysql_install_db doesn't install the privilige
tables but ends with:
Starting mysql server starting mysqld demon with databases from xxxxxx mysql demon ended
In this case you should examine the log in the xxxxxx directory very carefully! This contains the reason why mysqld didn't start. If you can't understand what happens, you should at least include the log when you post a bug report using mysqlbug!
Possible problems when running mysql_install_db are:
There is already a mysqld deamon running.
Installing a second mysqld daemon doesn't work when one daemon is running.
MYSQL_UNIX_PORT=/tmp/mysqld-new.sock MYSQL_TCP_PORT=3307 export MYSQL_UNIX_PORT MYSQL_TCP_PORT scripts/mysql_install_dbAfter this you should edit your server boot script to start both daemon with different sockets and ports (safe_mysqld --socket=... --port=....).
mysqld crashes at once.
MySQL mail archives.
See section Linux notes for all versions
Can't connect to the server (when using mit-threads)
mysql_install_db can't connect to the server you should check
that you have an entry in `/etc/hosts' like:
127.0.0.1 localhostThe above is only a problem on system that doesn't have a thread library and MySQL has to use mit-threads.
You don't have write access to create a socket file (in /tmp ?)
mysqld --help.
You can also specify paths for safe_mysqld by doing the following:
MYSQL_UNIX_PATH=/some_directory_for_tmp_files/mysqld.sock MYSQL_TCP_PORT=3306 TMPDIR=/some_directory_for_tmp_files/ export MYSQL_UNIX_PATH MYSQL_TCP_PORT TMPDIR scripts/mysql_install_db or bin/mysqld --skip-grant bin/mysql -u root mysqlAfter this you can execute the sql commands in mysql_install_db.
The paths may be different from what mysqld expects.
mysqld --help for more information. You can edit
bin/safe_mysqld to reflect the paths for your installation.
A simple test to see that everything is working is:
bin/mysqladmin version
Go to the first, previous, next, last section, table of contents.