LinuxQuestions.org
Help answer threads with 0 replies.
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 08-12-2013, 01:16 AM   #1
skush
LQ Newbie
 
Registered: Aug 2013
Posts: 26

Rep: Reputation: Disabled
mysql problem


I'm having a problem with mysql. When I run "rc.mysqld start" it returns:

130811 23:10:10 mysqld_safe Logging to '/var/lib/mysql/server.err'.
130811 23:10:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130811 23:10:12 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended

The logfile says:

130811 23:10:12 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
130811 23:10:12 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended

The same error arises when I use MariaDB from http://slackbuilds.org.

Any ideas as to what's going on?

Thanks.
 
Old 08-12-2013, 01:22 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,300

Rep: Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292Reputation: 4292
from the top of /etc/rc.d/rc.mysqld
Code:
# Before you can run MySQL, you must have a database.  To install an initial
# database, do this as root:
#
#   mysql_install_db --user=mysql
 
1 members found this post helpful.
Old 08-12-2013, 01:29 AM   #3
skush
LQ Newbie
 
Registered: Aug 2013
Posts: 26

Original Poster
Rep: Reputation: Disabled
Thanks for the help. I can't believe I didn't read that.
 
Old 08-12-2013, 01:38 AM   #4
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
There should be more lines of error produced with this.
well you can setup this to overcome the error;

Code:
mysql_install_db –user=mysql –ldata=/newlocation/of/your/mysqldata/dir        # mostly the location is /var/lib/mysql/ (but may vary)
service mysqld restart           # for redhat
 
Old 08-12-2013, 06:04 PM   #5
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by skush View Post
Thanks for the help. I can't believe I didn't read that.
There is a reason we use the term "README Encrypted" here
 
Old 03-24-2014, 07:53 PM   #6
boomhower182
LQ Newbie
 
Registered: Mar 2014
Distribution: Slackware, Arch
Posts: 28

Rep: Reputation: Disabled
I know this is an old post, but I have the same problem and I have ran the command 'mysql_install_db --user=mysql' and I still can't get it to start, and actually it was already running without running that command and all of a sudden it quit. I have even uninstalled mariadb and reinstalled it and even went from Slackware 14.1 to Slackware-current with still no luck, any help would be appreciated
 
Old 03-24-2014, 08:13 PM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,301
Blog Entries: 24

Rep: Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256
With all the reinstalling it is possible that you have overwritten or broken something - never a good idea.

So at this point, how are you trying to start it and what is the actual error you are seeing when you try to start it ("same as the last guy" is a good punchline, but not very helpful here...)?

Last edited by astrogeek; 03-24-2014 at 08:15 PM.
 
Old 03-24-2014, 09:25 PM   #8
boomhower182
LQ Newbie
 
Registered: Mar 2014
Distribution: Slackware, Arch
Posts: 28

Rep: Reputation: Disabled
this is the error that I get when I try to run mysql

root@microwave ~ # /etc/rc.d/rc.mysqld start
root@microwave ~ # 140324 22:18:29 mysqld_safe Logging to '/var/lib/mysql/microwave.err'.
140324 22:18:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140324 22:18:31 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
 
Old 03-24-2014, 10:39 PM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,301
Blog Entries: 24

Rep: Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256
OK, now lets check the DB directories.

As root, what do these say:

Code:
ls -l /var/lib/ |grep mysql
ls -l /var/lib/mysql/
 
Old 03-24-2014, 10:43 PM   #10
boomhower182
LQ Newbie
 
Registered: Mar 2014
Distribution: Slackware, Arch
Posts: 28

Rep: Reputation: Disabled
Code:
root@microwave ~ # ls -l /var/lib/ | grep mysql
drwxr-x--- 5 mysql      mysql   4096 Mar 24 22:24 mysql/

root@microwave ~ # ls -l /var/lib/mysql/
total 28776
-rw-rw---- 1 mysql mysql    16384 Mar 24 16:43 aria_log.00000001
-rw-rw---- 1 mysql mysql       52 Mar 24 16:43 aria_log_control
-rw-rw---- 1 mysql mysql  5242880 Mar 24 22:24 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 Mar 23 23:38 ib_logfile1
-rw-rw---- 1 mysql mysql 18874368 Mar 24 13:06 ibdata1
-rw-r----- 1 mysql root     66917 Mar 24 22:24 microwave.err
drwx------ 2 mysql root      4096 Mar 24 13:39 mysql/
drwx------ 2 root  root      4096 Mar 24 13:43 performance_schema/
drwx------ 2 mysql root      4096 Mar 24 13:39 test/
 
Old 03-24-2014, 10:48 PM   #11
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,301
Blog Entries: 24

Rep: Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256
Hmmm... I kind of expected there to be an ownership error, but apparently not...

What does tail /var/lib/mysql/microwave.err say immediately after you try to start it?
 
Old 03-24-2014, 10:51 PM   #12
boomhower182
LQ Newbie
 
Registered: Mar 2014
Distribution: Slackware, Arch
Posts: 28

Rep: Reputation: Disabled
Code:
root@microwave ~ # tail /var/lib/mysql/microwave.err
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
140324 23:50:43  InnoDB: Waiting for the background threads to start
140324 23:50:44 Percona XtraDB (http://www.percona.com) 5.5.35-MariaDB-33.0 started; log sequence number 1597945
140324 23:50:44 [Note] Plugin 'FEEDBACK' is disabled.
140324 23:50:44 [ERROR] mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
140324 23:50:44 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140324 23:50:44 [ERROR] mysqld: Can't find file: './mysql/host.frm' (errno: 13)
140324 23:50:44 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
140324 23:50:44 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
 
Old 03-24-2014, 10:54 PM   #13
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,301
Blog Entries: 24

Rep: Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256
For fun, do this:

Code:
chown -R mysql:mysql /var/lib/mysql/performance_schema
 
Old 03-24-2014, 10:56 PM   #14
boomhower182
LQ Newbie
 
Registered: Mar 2014
Distribution: Slackware, Arch
Posts: 28

Rep: Reputation: Disabled
just tried and get the same errors, it's actually strange because it use to run and then stopped and this was before the uninstalling and reinstalling and upgrading to current
 
Old 03-24-2014, 10:59 PM   #15
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,301
Blog Entries: 24

Rep: Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256Reputation: 4256
Sorry to do this kind of piece-meal, I am in the middle of something else too...

Try this...

Code:
ls -l /var/lib/mysql/mysql/
...and if everything not owned by mysql:mysql then...

Code:
chown -R mysql:mysql /var/lib/mysql/mysql/*
Also, do you have an /etc/my.cnf file? If so, what is in it?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
postfix +Cyrus SASL authentication problem + pam-mysql+mysql database kibirango Slackware 1 12-25-2012 08:47 AM
[SOLVED] yum install php-mysql create problem to my running mysql database jsaravana87 Linux - Server 1 08-11-2011 03:24 AM
Problem changing mysql uid,gid: mysql start fails gjatute Linux - Newbie 7 02-25-2010 01:38 AM
Problem Starting MySQL on Fresh Fedora 8 Install w/ Yum'd MySQL blong4life Linux - Server 2 07-04-2008 07:44 PM
php-mysql dependancy problem after nitemare mysql upgrade. RHEL4 andrewc Red Hat 1 01-03-2006 04:16 PM

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

All times are GMT -5. The time now is 03:32 PM.

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