LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 09-11-2010, 01:55 AM   #1
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Rep: Reputation: 15
MySQL Issue on Start


Hi,

I installed some days ago slackware 13.1. However the mysqld daemon doesn't start on boot nor I can't start it on my own.

I know that the mysqld is not configured in Slackware so I typed in my command line:

Code:
mysql_install_db
Code:
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h slackware_hostname password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!
Then I try to start MySQL daemon with "cd /usr ; /usr/bin/mysqld_safe &" and I get:

Code:
100911 09:51:46 mysqld_safe Logging to '/var/lib/mysql/slackware_hostname.err'.
100911 09:51:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100911 09:51:46 mysqld_safe mysqld from pid file /var/lib/mysql/slackware_hostname.pid ended
I tried also the "mysql_install_db --user=mysql" but I get the error:
Code:
Installing MySQL system tables...
100911  9:53:38 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/db.frm' (errno: 13)
ERROR: 1017  Can't find file: './mysql/db.frm' (errno: 13)
100911  9:53:38 [ERROR] Aborting

100911  9:53:38 [Note] /usr/libexec/mysqld: Shutdown complete


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /usr/libexec/mysqld --skip-grant &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /usr/bin/mysqlbug script!
The user mysql does exist in passwd

Thanks in advance

Last edited by simeon.mattes; 09-11-2010 at 01:57 AM.
 
Old 09-11-2010, 02:06 AM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Have you also tried the steps as indicated in the output?
Code:
Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /usr/libexec/mysqld --skip-grant &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.
Kind regards,

Eric
 
Old 09-11-2010, 05:08 AM   #3
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
Thanks EricTra for your response.

Yes I have tried them without any success. in "/var/lib/mysql" there are some probably log file which however I can't read them...

e.g. ib_logfile0
Code:
 offset    0  1  2  3   4  5  6  7   8  9  a  b   c  d  e  f  0123456789abcdef
00000000 <00>00 00 00  00 00 00 00  00 00 20 00  00 00 00 00  .......... .....
00000010  20 20 20 20  00 00 00 00  00 00 00 00  00 00 00 00      ............
00000020  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00000030  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................


.............
I tried also /usr/libexec/mysqld --skip-grant & but it ends immediately without any warnings.

I typed also "mysqld --help" and "mysqld --log" bu it doesn't find the command.

Finally I tried also this:
Code:
bash> /etc/rc.d/rc.mysqld start
root@mypc:/var/lib/mysql# 100911 13:07:20 mysqld_safe Logging to '/var/lib/mysql/slackware_hostname.err'.
100911 13:07:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100911 13:07:20 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended

Last edited by simeon.mattes; 09-11-2010 at 05:09 AM.
 
Old 09-11-2010, 05:32 AM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

Is there anything in the log files pointing to why MySQL is failing to start? Check
Code:
/var/log/messages
/var/log/syslog
for errors with regards to MySQL. Try restarting and right after that check the logs. Then post relevant output here.

Kind regards,

Eric
 
Old 09-11-2010, 04:09 PM   #5
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
Thanks again for your reply.

I haven't seen anything about mysql errors in /var/log/messages nor in syslog.

What I did was:
Code:
bash1>tail -f /var/log/messages
bash2>tail -f /var/log/syslog
and in a 3nd console I typed all the commands I wrote before. The only things I found in /var/log/messages about mysql were:

Code:
Sep  9 14:45:11 slackware_hostname sshd[4244]: Failed password for mysql from 212.51.223.139 port 46327 ssh2
Sep 10 13:02:45 slackware_hostname sshd[2142]: Failed password for mysql from 69.64.52.234 port 42778 ssh2
Sep 10 13:02:46 slackware_hostname sshd[2144]: Failed password for mysql from 69.64.52.234 port 42945 ssh2
Sep 11 12:18:47 slackware_hostname sshd[2449]: Accepted password for mysql from 211.191.168.223 port 50497 ssh2
Perhaps I should uninstall mysql and then reinstall it. How is that possible to do it easily in slackware

Last edited by simeon.mattes; 09-11-2010 at 04:11 PM.
 
Old 09-11-2010, 06:52 PM   #6
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 226Reputation: 226Reputation: 226
Perhaps starting again is in order..
I'll assume you have no valuable data in your database that is not backed up.

Code:
rm -rf /var/lib/mysql/*
Then try following the steps given here:

http://connie.slackware.com/~mrgobli...ware-lamp3.php
 
Old 09-12-2010, 03:11 AM   #7
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
Thanks mRgOBLIN for your reply,

I have done all you 've told me but without any success. I get the same messages. However I have noticed the following:

1. There wasn't before a my.cnf file in /etc.
2. The folder /var/run/mysql is empty:
a.When I start the server through "/etc/rc.d/rc.mysqld start" I can't see anywhere the "/var/run/mysql/mysql.pid

100912 11:00:59 mysqld_safe Logging to '/var/lib/mysql/slackware_hostname.err'.
100912 11:00:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/ mysql
100912 11:00:59 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
b. And as I see in the file my.cnf the following file/var/run/mysql/mysql.sock is used, which it doesn't exist in my /var/run/mysql folder

Because I have done a backup of slack 13.0 I see that in /var/run/mysql these 2 files, i.e. mysql.pid and mysql.sock, do exist.

I don't know what is happening but I didn't have such problems with slackware 13.0. Everything was preinstalled in my system and ready to work. I don't know If I did something wrong during the installation of slackware.

Also I wonder if it possible to uninstall completely mysql from my computer, not only the database files in /var/lib/mysql, and reinstall it.

Last edited by simeon.mattes; 09-12-2010 at 10:55 AM.
 
Old 09-13-2010, 08:14 AM   #8
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 226Reputation: 226Reputation: 226
Yes that's probably advisable at this stage.

Make sure you have the correct package for the Slackware version you are using.

Code:
removepkg mysql
installpkg mysql-ersion.txz
That mysql ssh login should not be happening.

Why do you have a mysql user on your system with a usable shell account? And.. was it you that logged in as mysql via ssh?

Last edited by mRgOBLIN; 09-13-2010 at 08:19 AM.
 
Old 09-13-2010, 09:59 PM   #9
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
Two additional thoughts on this. One, does /var/log/mysqld.log exist, and if so is there anything interesting inside? And two, what exactly is the situation with the mysql account and the permissions on /var/lib/mysql? Does a mysql account exist or not? Does that account own everything in /var/lib/mysql? Can it write to /var/run? Are you using that account to start the database?
 
Old 09-14-2010, 07:26 AM   #10
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,769
Blog Entries: 1

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
Quote:
Sep 9 14:45:11 slackware_hostname sshd[4244]: Failed password for mysql from 212.51.223.139 port 46327 ssh2
Sep 10 13:02:45 slackware_hostname sshd[2142]: Failed password for mysql from 69.64.52.234 port 42778 ssh2
Sep 10 13:02:46 slackware_hostname sshd[2144]: Failed password for mysql from 69.64.52.234 port 42945 ssh2
Sep 11 12:18:47 slackware_hostname sshd[2449]: Accepted password for mysql from 211.191.168.223 port 50497 ssh2
mRgOBILN is right, if this wasn't you logging in as mysql you've got a real problem, and even if it was, you still have a real problem. There should never be a login shell available to the mysql user.

Last edited by Hangdog42; 09-14-2010 at 07:27 AM.
 
Old 09-15-2010, 04:00 PM   #11
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
Actually it was me...I have created a mysql user. I was trying to find out what is going on and I have given him permissions.

As far as it concerns the /var/run/mysql and /var/lib/mysql the mysql user is the owner. How do I remove access to the bash for mysql user?


Finally, I make it work. What I did was:
Code:
removepkg mysql
and I follow the instructions of Setup Configure Mysql Slackare. They are the same for slackware 13.1. The only difference is /etc/slackpkg/mirrors I uncomment the line that had to do with 13.1 version.

I'm not so sure, but I think the problem was finally in the permissions of /var/run/mysql which was

Code:
drwx------ 2 mysql     mysql     4096 Sep 15 23:49 mysql
And I made it
Code:
drwxr-xr-x 2 mysql     mysql     4096 Sep 15 23:49 mysql
Thanks again for your help

Last edited by simeon.mattes; 09-15-2010 at 05:33 PM.
 
Old 09-15-2010, 05:33 PM   #12
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,769
Blog Entries: 1

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
Quote:
How do I remove access to the bash for mysql user?
You should be able to do it with the usermod command:

Code:
usermod -s /bin/false mysql
If you check in /etc/passwd, the mysql user should now have /bin/false as their "shell" and shouldn't be able to log in.
 
Old 09-16-2010, 12:49 PM   #13
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
Thanks
 
Old 09-28-2010, 10:20 PM   #14
btncix
Member
 
Registered: Aug 2009
Location: NC, USA
Distribution: Slackware x86
Posts: 141

Rep: Reputation: 26
I came across this thread because I want to setup LAMP on my slackware 13.1 x86 32 bit system. This thread helped me look for a solution different from what the original poster did.


The following worked for me when I executed the commands below as root user:
!!NOTE!!: When I installed slackware 13.1, I did a complete/full install of all packages on the slackware dvd
1. # chmod 755 /etc/rc.d/rc.mysqld
2. # mysql_install_db --user=mysql
3. # cd /usr ; /usr/bin/mysqld_safe
4. # /usr/bin/mysqladmin -u root password 'new-password'
5. # /usr/bin/mysql_secure_installation
 
Old 09-29-2010, 07:07 AM   #15
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware
Posts: 123

Rep: Reputation: 19
Instructions I followed in setting up my LAMP
http://www.linuxquestions.org/questi...8/#post3390789
even though it says slackware 12.2, i used it for slackware 13.0 and 13.1 without a problem. I didn't encounter any problem in MySQL configuration when i followed the steps in here.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
After moving mysql db to NFS[netapp] unable to start mysql server throws error naveenrajn Linux - General 3 09-13-2010 02:20 AM
Apache2, PHP5, or MYSQL issue: Unable to jump to row 0 on MySQL ..... MTAS Linux - Server 5 03-26-2010 09:13 AM
Problem changing mysql uid,gid: mysql start fails gjatute Linux - Newbie 7 02-25-2010 01:38 AM
Fedora 9:No mysql.sock file found. Cannot start mysql smilingbuddha Linux - Software 3 03-21-2009 03:06 AM
I have RHEL 5.0 and MySQL start problem, my MySQL server doesn't start rsatya Linux - Enterprise 4 02-03-2009 12:04 PM


All times are GMT -5. The time now is 01:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration