MySQL Forums
Forum List  »  Newbie

Re: Starting MySQL problem
Posted by: Russell Dyer
Date: June 24, 2005 11:18PM

This messages occurs when the MySQL server cannot find the mysql privileges database or other critical files. This error is often encountered when the MySQL base or data directories are installed in different locations than the default locations used for a manual install. So, look in the configuration file (i.e., /etc/my.cnf) and see where these directories are expected to be. It will probably look like this:

[mysqld]
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data

If your data is located in a different directory, you'll need to adjust these two values. Just edit the my.cnf file with a text editor like vi. They can also be set at the command-line when booting up the server by adding leading double-dashes to each option (i.e., --basedir=/usr/local/mysql).

If your configuration file is correct, though, it may be that you just need to create your grants tables (the mysql database). This can be done with the mysql_install_db script provide with the standard distribution of MySQL. Change to the base directory of MySQL and run the script from there like so:

cd /usr/local/mysql
./scripts/mysql_install_db

Use the relative path in the second line here so that it will create the table in ./data directory. This should create a mysql database for you. When you first log in as root, there will be no password. Your first task should be to set the root user's password. This can be done by entering the following from the command-line

mysqladmin -p password my_pwd

The -p instructs mysqladmin to prompt you for the current password, which is blank. So just hit [Enter]. Replace my_pwd in the line above with your new pasword.

Options: ReplyQuote


Subject
Written By
Posted
June 24, 2005 08:28PM
Re: Starting MySQL problem
June 24, 2005 11:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.