Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I already have an instance of MySQL running a production system. I want to use the same machine to do other MySQL stuff without touching the other instance. I copied my.cnf and rerouted everything (port,datadir,etc). Running mysqld_safe using the new config stopped right away. I looked at the logs. Everything looked good until this line:

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

So, I run mysql_install_db --datadir=my/new/db and get this:

Installing MySQL system tables...
091120 19:01:24 [ERROR] /usr/libexec/mysqld: unknown option '-e'

Installation of system tables failed!

Examine the logs in opt/mysqld/data/ for more information.
You can try to start the mysqld daemon with:
/usr/libexec/mysqld --skip-grant &
and use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in opt/mysqld/data/ that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!

I'm not giving a -e option on my call. What do I do?

EDIT: I followed the instructions in the error and get access denied for 'root'@'localhost'. The server is running and the appropriate port is listening. How do I log-in after doing a skip-grant?

share|improve this question
    
when you are using the skip-grant option you log on without a password –  Jure1873 Nov 23 '09 at 15:44

2 Answers 2

I'm not sure what the -e error means, but you should be able to restart MySQL with a --skip-grant-tables option and manually populate (and create) the tables if you're running into issues.

The SQL files exist under /usr/share/mysql, at least on RHEL 5. They're installed in the following order:

  1. mysql_system_tables.sql
  2. mysql_system_tables_data.sql
  3. fill_help_tables.sql

Note that there is a 'sed' command that replaces '@current_hostname' in those files with your actual hostname. The install database script also creates the test & mysql database directories using 'mkdir' and sets the appropriate ownership and permissions.

share|improve this answer
    
That helps a little. I found the .sql files, but mysql refuses to let me log-in. –  User1 Nov 23 '09 at 15:39
up vote 0 down vote accepted

mysql_install_db --datadir=my/new/db uses a relative path. It worked when I used an absolute path.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.