From: Andy Ferguson (ilug at domain moil.demon.co.uk)
Date: Tue 04 May 1999 - 23:28:50 IST
On Tue, 4 May 1999 Ruairi.Newman at domain deloitte.ie wrote:
> I installed mysql (mysql -V = "mysql Ver9.15 Distrib 3.21.30, for
> pc-linux-gnu (i586)") on Friday as part of a project I am working on.
> Everything seems to have unpacked and installed correctly, but on
> running mysqld, I get the following:
>
> "mysqld: Can't find file: 'host.frm' (errno: 2)"
>
MySQL uses its own database to manage access rights. This database
(mysql) contains tables user, host, db and func and these must exist
for mysql to function.
With your distribution there should be a script somewhere which will
initialise the privileges database - it may be in a bin dir. Usual
place and name is
./scripts/mysql_install_db.sh
under the distribution dir.
Run it and most things will be fine. If you want to connect to mysql
from a different machine and other local users, you will have to add
appropriate entries into these tables. Unless you are concerned over
security breaches, setting all switches to Y with no password checks
will suffice.
A typical mysql dialogue might be
mysql mysql
insert into user values ("localhost","username","","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y");
insert into host values ("remote_host","%","Y","Y","Y","Y","Y","Y");
insert into db values ("%","my_dbase","","Y","Y","Y","Y","Y","Y");
\q
These commands
give a local user called "username" full access
gives a remote host "remote_host" full access
gives everyone access to a database called my_dbase
the % char acts as a wildcard
mysql has a command history like bash; use it to correct mistakes if
you or I type the wrong number of "Y"s
After changing these tables, they need to be re-read to become
active - either stop/start the mysql server or use the "refresh"
command as in
mysqladmin refresh
Create a new database with
mysqladmin create my_dbase
tables and records are then entered with an mysql dialogue
initiated with
mysql my_dbase
If your binary distribution did not include the manual get it as
soon as; it contains the syntax for all commands and the various API
calls. It assumes a basic knowledge/understanding of SQL commands.
These days apache and perl come with PHP and DBI modules built-in which
trivialises calls from perl or cgi scripts to MySQL dbases. Again
check the documentation for PHP as call syntax to mysql and string
concatenation are specific to PHP
Andy Ferguson
~~~~~~~~~~~~~
Sysop MOIL BBS +44-1247-273357
andy at domain moil.demon.co.uk
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:10 GMT