Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Avoid a possible MySQL5 error on first run UNIX
Downloading and installing MySQL 5 is a fairly straight-forward process, especially when using the official package from the MySQL folks, as they use a Mac OS X .pkg installer. The last step for starting the server requires entering these three Unix commands in Terminal.app:
 $ cd /usr/local/mysql
 $ sudo chown -R mysql data/
 $ sudo ./bin/mysqld_safe &
Instead of a happy MySQL server, I consistently received the following error message:
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
After much Googling and gnashing of teeth, I stumbled upon a fix in the section titled 'Database Re-Initialization' on Marc Liyanage's entropy.ch site. Before running the mysqld_safe command, enter this:
 $ sudo hostname 127.0.0.1
and Bob's your uncle. I exchanged a note with Marc, who told me that it's a DNS problem. I presume my problem is that I installed MySQL on my Mac on my home network without a DNS, and the 10.4 default URL for my machine is macname.local. Apparently the mysqld_safe command has MySQL connect to itself during launch -- and nobody was home. The Rendez... er, Bonjour .local URL nomenclature strikes again?
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[10,882 views]  

Avoid a possible MySQL5 error on first run | 1 comments | Create New Account
Click here to return to the 'Avoid a possible MySQL5 error on first run' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Avoid a possible MySQL5 error on first run
Authored by: derekhed on Aug 10, '05 01:20:46PM
I may have copied this over from my prior installation (10.3.9), but the /etc/hosts file usually contains an entry to translate localhost to 127.0.0.1 Here is an excerpt of mine:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
The nice thing is you can add your own urls to refer to your own machine any way you want. This over-rides the 'official' domain names, but is very useful for testing dynamic websites. Here is one of my lines after editing the file:
127.0.0.1       localhost www.testder.com
Now www.testder.com will always refer to my own machine.

[ Reply to This | # ]