Unix Technical Forum

trouble getting mysql to work

This is a discussion on trouble getting mysql to work within the Linux Operating System forums, part of the Unix Operating Systems category; --> I just installed Slackware 10.2 and can't get mysql to load up. Searching newsgroups for answers I came across ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 06:24 PM
Liam
 
Posts: n/a
Default trouble getting mysql to work

I just installed Slackware 10.2 and can't get mysql to load up.

Searching newsgroups for answers I came across a previous request from
myself here:
http://groups.google.com/group/comp....b25f1e b0431d
It was for 10.1 on a laptop. I don't know if I ever got it to work...
that laptop is long dead, and this message thread doesn't indicate if I
succeeded. =)
But it's the exact same problem, and I did exactly what was suggested
in this thread, and no go.

The problem is:
I try to start mysql and I get:

root@slackserve:~# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run /mysql/mysql.sock' (2)

and in /var/lib/mysql/slackserve.err
I have:

060313 15:13:55 mysqld started
060313 15:13:59 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
060313 15:13:59 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43634.
InnoDB: Doing recovery: scanned up to log sequence number 0 43634
060313 15:14:00 InnoDB: Flushing modified pages from the buffer
pool...
060313 15:14:00 InnoDB: Started; log sequence number 0 43634
060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
'./mysql/host.frm' (errno: 13)
060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
'./mysql/host.frm' (errno: 13)
060313 15:14:00 [ERROR] Fatal error: Can't open privilege tables: Can't
find file: './mysql/host.frm' (errno:
13)
060313 15:14:00 mysqld ended


As in that other thread, I ran:
/usr/bin/mysql_install_db

and
[rc.d]# cd /var/lib
[lib]# chown -R mysql:mysql mysql

and when I /etc/rc.d/rc.mysql start
I still get:

Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
mysqld ended

Any suggestions?
Thanks!
Liam

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 06:24 PM
frank
 
Posts: n/a
Default Re: trouble getting mysql to work

On Mon, 13 Mar 2006 13:31:44 -0800, Liam wrote:

> <snip>
> 060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
> './mysql/host.frm' (errno: 13)
> 060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
> './mysql/host.frm' (errno: 13)
> 060313 15:14:00 [ERROR] Fatal error: Can't open privilege tables: Can't
> find file: './mysql/host.frm' (errno:
> 13)
> 060313 15:14:00 mysqld ended
> <snip>
> and when I /etc/rc.d/rc.mysql start
> I still get:
>
> Starting mysqld daemon with databases from /var/lib/mysql
> STOPPING server from pid file /var/run/mysql/mysql.pid
> mysqld ended
>
> Any suggestions?
> Thanks!
> Liam


Liam,

I haven't seen these particular messages before but the errors that
precede the exit seem pretty explicit: "Can't find file..."

Is that file (host.frm) present? If not, you're not completely installed.
MySQL won't run without its host data. On my computer with a freshly
installed 5.0.18-0 which installed uneventfully, in the expected location
(/var/lib/mysql/) and fired right up running from the installation rpms,
that file is under the above plus /mysql/host.frm.

Frank
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-18-2008, 06:24 PM
Liam
 
Posts: n/a
Default Re: trouble getting mysql to work


frank wrote:
> On Mon, 13 Mar 2006 13:31:44 -0800, Liam wrote:
>
> > <snip>
> > 060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
> > './mysql/host.frm' (errno: 13)
> > 060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
> > './mysql/host.frm' (errno: 13)
> > 060313 15:14:00 [ERROR] Fatal error: Can't open privilege tables: Can't
> > find file: './mysql/host.frm' (errno:
> > 13)
> > 060313 15:14:00 mysqld ended
> > <snip>
> > and when I /etc/rc.d/rc.mysql start
> > I still get:
> >
> > Starting mysqld daemon with databases from /var/lib/mysql
> > STOPPING server from pid file /var/run/mysql/mysql.pid
> > mysqld ended
> >
> > Any suggestions?
> > Thanks!
> > Liam

>
> Liam,
>
> I haven't seen these particular messages before but the errors that
> precede the exit seem pretty explicit: "Can't find file..."
>
> Is that file (host.frm) present? If not, you're not completely installed.
> MySQL won't run without its host data. On my computer with a freshly
> installed 5.0.18-0 which installed uneventfully, in the expected location
> (/var/lib/mysql/) and fired right up running from the installation rpms,
> that file is under the above plus /mysql/host.frm.
>

Hmm, indeed, slocate failed to find that file.
I did a full Slackware 10.2 install, but I guess something did work
quite right.
I'll see about reinstalling the package.

Thanks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-18-2008, 06:24 PM
Thor-Inge
 
Posts: n/a
Default Re: trouble getting mysql to work

Liam wrote:
> frank wrote:
>> On Mon, 13 Mar 2006 13:31:44 -0800, Liam wrote:
>>
>>> <snip>
>>> 060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
>>> './mysql/host.frm' (errno: 13)
>>> 060313 15:14:00 [ERROR] /usr/libexec/mysqld: Can't find file:
>>> './mysql/host.frm' (errno: 13)
>>> 060313 15:14:00 [ERROR] Fatal error: Can't open privilege tables: Can't
>>> find file: './mysql/host.frm' (errno:
>>> 13)
>>> 060313 15:14:00 mysqld ended
>>> <snip>
>>> and when I /etc/rc.d/rc.mysql start
>>> I still get:
>>>
>>> Starting mysqld daemon with databases from /var/lib/mysql
>>> STOPPING server from pid file /var/run/mysql/mysql.pid
>>> mysqld ended
>>>
>>> Any suggestions?
>>> Thanks!
>>> Liam

>> Liam,
>>
>> I haven't seen these particular messages before but the errors that
>> precede the exit seem pretty explicit: "Can't find file..."
>>
>> Is that file (host.frm) present? If not, you're not completely installed.
>> MySQL won't run without its host data. On my computer with a freshly
>> installed 5.0.18-0 which installed uneventfully, in the expected location
>> (/var/lib/mysql/) and fired right up running from the installation rpms,
>> that file is under the above plus /mysql/host.frm.
>>

> Hmm, indeed, slocate failed to find that file.
> I did a full Slackware 10.2 install, but I guess something did work
> quite right.
> I'll see about reinstalling the package.
>
> Thanks
>

I have the same problem. Installed mysql from current with gslapt.

Thor-inge
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-18-2008, 06:24 PM
Thomas Ronayne
 
Posts: n/a
Default Re: trouble getting mysql to work

Liam wrote:
> I just installed Slackware 10.2 and can't get mysql to load up.
>
>
> The problem is:
> I try to start mysql and I get:
>
> root@slackserve:~# mysql
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/run /mysql/mysql.sock' (2)
>
>
>

Did you run mysql_install_db? You need to do that on a new installation with

mysql_install_db --user=mysql

--
Everything works -- if you let it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-18-2008, 06:25 PM
Thor-Inge
 
Posts: n/a
Default Re: trouble getting mysql to work

Thomas Ronayne wrote:
> Liam wrote:
>> I just installed Slackware 10.2 and can't get mysql to load up.
>>
>>
>> The problem is:
>> I try to start mysql and I get:
>>
>> root@slackserve:~# mysql
>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
>> '/var/run /mysql/mysql.sock' (2)
>>
>>
>>

> Did you run mysql_install_db? You need to do that on a new installation
> with
>
> mysql_install_db --user=mysql
>


Whitch permissions should /var/lib/mysql/ have

I got this error

60314 23:43:31 mysqld started
060314 23:43:32 InnoDB: Operating system error number 13 in a file
operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
060314 23:43:32 mysqld ended


Thor-Inge

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-18-2008, 06:26 PM
Thomas Ronayne
 
Posts: n/a
Default Re: trouble getting mysql to work

Thor-Inge wrote:
>
> Whitch permissions should /var/lib/mysql/ have
>
> Thor-Inge
>

You may not have done the initial set up of MySQL logged in as root?
Gotta do that on a new installation.

Go look at
http://dev.mysql.com/doc/refman/4.1/...tallation.html. If
you installed MySQL from the Slackware distribution CD-ROM, the BASEDIR
is /var/lib/mysql.

* Log in as root (you *must* be root to do this)
* cd /var/lib
* ls -l
If the mysql directory in /var/lib is *not*
drwxr-x--- 8 mysql mysql 1584 2006-03-12 10:51 mysql/
(the size will not be 1584, don't worry about the size, only the
mask, owner and group)
do this:
o chown mysql mysql
o chgrp mysql mysql
o chmod 750 mysql
* cd /var/lib/mysql
* mysql_install_db --user=mysql
* ls -l

You should have a directory mysql and a directory test; they should look
like this:

drwx------ 2 mysql root 1584 2005-10-05 08:42 mysql/
drwx------ 2 mysql root 384 2005-10-05 13:12 test/

You will also have one or more files named ib_something; they should be
owned by mysql, group mysql, mask -rw-rw----.

The content of the mysql directory (this is /var/lib/mysql/mysql) should
be owned by mysql, group mysql and the permission mask for all files
should be -rw-rw----.

Now, if you do not have the above, you can (*if* you do not have any
existing data bases other than the mysql and test data bases!)

* Log in as root
* cd /var/lib/mysql
* rm -r *
* mysql_install_db --user=mysql

The above will set things up the way they're supposed to be. Then, as
root, start MySQL with

sh /etc/rc.d/rc.mysqld start

and you should be good to go.

--
Everything works -- if you let it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-18-2008, 06:26 PM
Thor-Inge
 
Posts: n/a
Default Re: trouble getting mysql to work

Thomas Ronayne wrote:
> Thor-Inge wrote:
>>
>> Whitch permissions should /var/lib/mysql/ have
>>
>> Thor-Inge
>>

> You may not have done the initial set up of MySQL logged in as root?
> Gotta do that on a new installation.
>
> Go look at
> http://dev.mysql.com/doc/refman/4.1/...tallation.html. If
> you installed MySQL from the Slackware distribution CD-ROM, the BASEDIR
> is /var/lib/mysql.
>
> * Log in as root (you *must* be root to do this)
> * cd /var/lib
> * ls -l
> If the mysql directory in /var/lib is *not*
> drwxr-x--- 8 mysql mysql 1584 2006-03-12 10:51 mysql/
> (the size will not be 1584, don't worry about the size, only the
> mask, owner and group)
> do this:
> o chown mysql mysql
> o chgrp mysql mysql
> o chmod 750 mysql
> * cd /var/lib/mysql
> * mysql_install_db --user=mysql
> * ls -l
>
> You should have a directory mysql and a directory test; they should look
> like this:
>
> drwx------ 2 mysql root 1584 2005-10-05 08:42 mysql/
> drwx------ 2 mysql root 384 2005-10-05 13:12 test/
>
> You will also have one or more files named ib_something; they should be
> owned by mysql, group mysql, mask -rw-rw----.
>
> The content of the mysql directory (this is /var/lib/mysql/mysql) should
> be owned by mysql, group mysql and the permission mask for all files
> should be -rw-rw----.
>
> Now, if you do not have the above, you can (*if* you do not have any
> existing data bases other than the mysql and test data bases!)
>
> * Log in as root
> * cd /var/lib/mysql
> * rm -r *
> * mysql_install_db --user=mysql
>
> The above will set things up the way they're supposed to be. Then, as
> root, start MySQL with
>
> sh /etc/rc.d/rc.mysqld start
>
> and you should be good to go.
>

Now I think it works.
A newbie/noob thanks for all the help.
Any reason why mysql don't run out of the box with Slackware or is it
like that for all distros


root@darkstar:/bin# mysqladmin version
mysqladmin Ver 8.41 Distrib 5.0.18, for slackware-linux-gnu on i486
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 5.0.18
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysql/mysql.sock
Uptime: 13 min 31 sec

Threads: 1 Questions: 1 Slow queries: 0 Opens: 0 Flush tables: 1
Open tables: 6 Queries per second avg: 0.001
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-18-2008, 06:26 PM
Thomas Ronayne
 
Posts: n/a
Default Re: trouble getting mysql to work

Thor-Inge wrote:
> Now I think it works.

Good.
> A newbie/noob thanks for all the help.

Yer welcome.
> Any reason why mysql don't run out of the box with Slackware or is it
> like that for all distros

Look at
http://dev.mysql.com/doc/refman/4.1/...tallation.html --
yeah, you have to do that for any new installation of MySQL (and I've
had to do that on every Linux distribution and Solaris distribution I've
installed MySQL on). RTFM (almost) always works. The keyword might be
"installed;" perhaps some distributions do you a "big favor" and execute
mysql_install_db for you, but neither Slackware or Solaris do so you
don't have to have it if you don't want it, maybe.

--

Everything works -- if you let it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com