[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
mysql_install_db
The purpose of the mysql_install_db
script is to generate new MySQL
privilege tables. It will not overwrite existing MySQL privilege tables,
and it will not affect any other data.
If you want to re-create your privilege tables, you should take down
the mysqld
server, if it's running, and then do something like:
mv mysql-data-directory/mysql mysql-data-directory/mysql-old mysql_install_db |
This section lists problems you might encounter when you run
mysql_install_db
:
mysql_install_db
doesn't install the grant tables
You may find that mysql_install_db
fails to install the grant
tables and terminates after displaying the following messages:
Starting mysqld daemon with databases from XXXXXX mysqld ended |
In this case, you should examine the log file very carefully. The log
should be located in the directory `XXXXXX' named by the error message,
and should indicate why mysqld
didn't start. If you don't understand
what happened, include the log when you post a bug report.
See section 1.7.1.3 How to Report Bugs or Problems.
mysqld
process running
In this case, you probably don't have to run mysql_install_db
at
all. You have to run mysql_install_db
only once, when you install
MySQL the first time.
mysqld
server doesn't work when one server is running
This can happen when you already have an existing MySQL
installation, but want to put a new installation in a different location (for
example, for testing, or perhaps you simply want to run two installations at
the same time). Generally the problem that occurs when you try to run the
second server is that it tries to use the same socket and port as the old one.
In this case you will get the error message: Can't start server: Bind on
TCP/IP port: Address already in use
or Can't start server: Bind on
unix socket...
. See section 5.9 Running Multiple MySQL Servers on the Same Machine.
If you don't have write access to create a socket file at the default place
(in `/tmp') or permission to create temporary files in `/tmp,'
you will get an error when running mysql_install_db
or when
starting or using mysqld
.
You can specify a different socket and temporary directory as follows:
shell> TMPDIR=/some_tmp_dir/ shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysqld.sock shell> export TMPDIR MYSQL_UNIX_PORT |
See Problems with `mysql.sock'.
`some_tmp_dir' should be the path to some directory for which you have write permission. See section E. Environment Variables.
After this, you should be able to run mysql_install_db
and start
the server with these commands:
shell> scripts/mysql_install_db shell> BINDIR/mysqld_safe & |
mysqld
crashes immediately
If you are running Red Hat Version 5.0 with a version of glibc
older than
2.0.7-5, you should make sure you have installed all glibc
patches.
There is a lot of information about this in the MySQL mail
archives. Links to the mail archives are available online at
http://lists.mysql.com/.
Also, see 2.6.1 Linux Notes.
You can also start mysqld
manually using the --skip-grant-tables
option and add the privilege information yourself using mysql
:
shell> BINDIR/mysqld_safe --skip-grant-tables & shell> BINDIR/mysql -u root mysql |
From mysql
, manually execute the SQL commands in
mysql_install_db
. Make sure you run mysqladmin
flush-privileges
or mysqladmin reload
afterward to tell the server to
reload the grant tables.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |