Go to the first, previous, next, last section, table of contents.


Problems running mysql_install_db

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.
In this case you have probably don't have to run mysql_install_db at all. One only have to run mysql_install_db once when one install MySQL the first time.
Installing a second mysqld daemon doesn't work when one daemon is running.
The problem is the new server tries to use the same socket and port as the old one. You can start the new server with a different socket and port as follows:
MYSQL_UNIX_PORT=/tmp/mysqld-new.sock
MYSQL_TCP_PORT=3307
export MYSQL_UNIX_PORT MYSQL_TCP_PORT
scripts/mysql_install_db
After 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.
If you are running RedHat 5.0 and a glibc version before glibc 2.0.7-5 you should check that you have installed all glibc patches! There is a lot of information about this in the MySQL mail archives. See section Linux notes for all versions
Can't connect to the server (when using mit-threads)
If 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		localhost
The 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 ?)
In this case you have to start mysqld manually and add the privilege information yourself. If you are using a binary version and are not installing in /usr/local/mysql, you have specify the paths mysqld should use with arguments. You can get information about which paths mysqld uses and the how to change them with 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 mysql
After this you can execute the sql commands in mysql_install_db.
The paths may be different from what mysqld expects.
You can override all paths to mysqld with command line arguments. Use 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.