LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-10-2006, 01:43 PM   #1
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Rep: Reputation: 15
mySQL starts then Stops, no 'mysql.host'


I installed mySQL in the initial installation. When I boot it starts but then in a few seconds stops. An error log indicates that it "Can't open privelege tables: 'mysql.host' doesn't exist.

Where should it be, where can I find it?

I eventually want to use a C++ API to connect to and interact with the DataBase.

Dave
 
Old 05-10-2006, 02:44 PM   #2
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
Init new DB but still problems

Looking at other threads, Iwent and installed an initial DataBase, while got me half a step further. But now the log says /usr/libexec/mysqld: Can't find file './mysql/host.frm'

My database is in /var/lib/mysql and in that directory is a directory mysql which has the database files. 'host.frm' is there along with host.MY1 and host.MYD. The access rights seem to be OK, why can't it be seen.

DaveHB
 
Old 05-11-2006, 09:00 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
You're using slackware? In versions 10.0 and 10.1 (can't speak for other versions):
Check the file /etc/rc.mysqld to check where it expects the database.
Code:
# Start mysqld:
mysqld_start() {
  if [ -x /usr/bin/mysqld_safe ]; then
    # If there is an old PID file (no mysqld running), clean it up:
    if [ -r /var/run/mysql/mysql.pid ]; then
      if ! ps axc | grep mysqld 1> /dev/null 2> /dev/null ; then
        echo "Cleaning up old /var/run/mysql/mysql.pid."
        rm -f /var/run/mysql/mysql.pid
      fi
    fi
    /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid $SKIP &
  fi
}
Correct if necessary. Restart mysql server so changes take effect.

It might be the solution.
 
Old 05-11-2006, 09:17 AM   #4
wchild
Member
 
Registered: Mar 2006
Distribution: Slackware
Posts: 63

Rep: Reputation: 15
It is not enough to install the mysql package.
After installation you have to run as root a certain script from that package which creates the system tables.
 
Old 05-12-2006, 01:12 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
He did that (and hopefully not as root but as user mysql).
 
Old 05-12-2006, 12:18 PM   #6
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Wim's parenthetic comment is important! This happened to me once, and it was because I initialized the databases as root rather than as mysql user.

Brian
 
Old 05-13-2006, 09:38 AM   #7
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
Yeah, I did it as root. That's probably the problem then. Also I'll check rc.mysql and let you all know how it came out

DavidHB
 
Old 05-15-2006, 08:01 AM   #8
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
Install as user mysql is the key

Thanks All,

That was the key, to install the mysql database as user mysql.

Start as root, su to mysql, execute the script and roboot!

Thanx
DavidHB
 
Old 05-15-2006, 10:17 AM   #9
wchild
Member
 
Registered: Mar 2006
Distribution: Slackware
Posts: 63

Rep: Reputation: 15
Hehe I forgot the middle step
su mysql
 
Old 08-08-2006, 04:38 AM   #10
Iketani
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
I have the same problem, i am trying su mysql but then i am asked for a password and it is allways incorrect
 
Old 08-08-2006, 05:11 AM   #11
Iketani
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by Iketani
I have the same problem, i am trying su mysql but then i am asked for a password and it is allways incorrect
Ok problem solved i just had to "su root" and then "su mysql" and now my mysql is working fine
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
Mysql starts and suddendly stops braungiobi Linux - Software 4 03-13-2005 09:27 AM
MySQL setup stops at command "./configure --prefix=/usr/local/mysql" k41184 Linux - Software 1 05-20-2004 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration