LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   MySQL Issue on Start (https://www.linuxquestions.org/questions/slackware-14/mysql-issue-on-start-831507/)

simeon.mattes 09-11-2010 01:55 AM

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

EricTRA 09-11-2010 02:06 AM

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

simeon.mattes 09-11-2010 05:08 AM

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


EricTRA 09-11-2010 05:32 AM

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

simeon.mattes 09-11-2010 04:09 PM

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

mRgOBLIN 09-11-2010 06:52 PM

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

simeon.mattes 09-12-2010 03:11 AM

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.

mRgOBLIN 09-13-2010 08:14 AM

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?

mcd 09-13-2010 09:59 PM

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?

Hangdog42 09-14-2010 07:26 AM

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.

simeon.mattes 09-15-2010 04:00 PM

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

Hangdog42 09-15-2010 05:33 PM

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.

simeon.mattes 09-16-2010 12:49 PM

Thanks

btncix 09-28-2010 10:20 PM

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

jrecortel 09-29-2010 07:07 AM

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.


All times are GMT -5. The time now is 02:09 PM.