You are not logged in.

#1 2009-12-12 15:21:23

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

[SOLVED] - mysqld won't start

The other day I wanted to check on Akonadi and noticed that my mysql daemon fails.

Checked everything.log but nothing.

Looked at the wiki and noticed I had no mysql directories in /var so I created them:

toad@deskarch 394\40 /var/run > lla|grep my
drwxr-xr-x  2 mysql mysql     4.0K 2009-12-12 15:59 mysqld

Apart from that I tried everything in the wiki but due to my ignorance of WTF it is all about I could not get it to work.

The only other vaguely useful (?) info I can give is:

sudo mysql -u root mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Any pointers, please?

Last edited by toad (2009-12-14 17:54:03)


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#2 2009-12-14 07:27:25

Deuterium
Member
Registered: 2009-09-26
Posts: 50

Re: [SOLVED] - mysqld won't start

i found the problem your experiencing here http://forums.fedoraforum.org/archive/i … 19402.html.  what are the permissions to /var/lib/mysql?  also, why are you using

sudo mysql -u root mysql

instead of

sudo mysql

or something similar?

Offline

#3 2009-12-14 09:09:35

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - mysqld won't start

Thanks Deuterium!

The link appears to be mainly about rights. As stated in post #1 rights should not be an issue. A further link in that link said that people hadn't started their daemon - well, I prolly forgot to say that

toad@deskarch 522\38 ~ > sudo /etc/rc.d/mysqld start
Password:
:: Starting MySQL                                                                                                                                                  [FAIL]

mad

I wouldn't mind starting afresh with a reinstall but pacman won't let me remove mysql 'cos of dependencies. Should I attempt to force?

EDIT:

forget to say, I did mysql -p -u root 'cos it is in the wiki smile

Last edited by toad (2009-12-14 09:10:20)


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#4 2009-12-14 09:48:14

Deuterium
Member
Registered: 2009-09-26
Posts: 50

Re: [SOLVED] - mysqld won't start

ok, is it possible to get some verbose output? i dont have mysqld but from looking at the man page, it might be 'something' like

mysqld --verbose

Also, the log file of mysqld should be called host_name.log (where host_name is the hostname of your pc) and will probably be in /var/log and try looking for a mysql subdirectory.  if you find the log file, it might help somebody deduce what the error was.

Offline

#5 2009-12-14 10:20:49

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - mysqld won't start

All top tips!

toad@deskarch 526\48 ~ > mysqld --verbose
091214 11:03:10 [Warning] Can't create test file /var/deskarch.lower-test
091214 11:03:10 [Warning] Can't create test file /var/deskarch.lower-test
091214 11:03:10 [Note] Plugin 'FEDERATED' is disabled.
091214 11:03:10 [Note] Plugin 'ndbcluster' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
091214 11:03:10 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
091214 11:03:10  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: 'create'.
InnoDB: Cannot continue operation.

Lines 1-2 (Can't create test file /var/deskarch.lower-test) - I am loathed to change the whole of var to mysql:mysql and do not see anything in /etc/mysql/my.conf to change this. See below:

toad@deskarch 536\69 /var/log > cat /etc/mysql/my.cnf|grep var
socket          = /var/run/mysqld/mysqld.sock
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
# 2) Set the variables below. However, in case you choose this method, then
#    change in this file to the variables' values below will be ignored and
#innodb_data_home_dir = /var/lib/mysql
#innodb_log_group_home_dir = /var/lib/mysql
#innodb_log_arch_dir = /var/lib/mysql

toad@deskarch 537\70 /var/log >
.
.
toad@deskarch 539\73 /var/log > lla /var/run/mysqld/
total 8.0K
drwxr-xr-x  2 mysql mysql 4.0K 2009-12-14 11:05 .
drwxr-xr-x 28 root  root  4.0K 2009-12-14 07:40 ..

toad@deskarch 539\74 /var/log > lla /var/lib/|grep my
drwxr-xr-x  2 mysql     mysql     4.0K 2009-12-14 11:05 mysql

toad@deskarch 539\75 /var/log >

Line 6 (Please run mysql_upgrade to create it.):

toad@deskarch 526\49 ~ > mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

Your hint re the logs:

toad@deskarch 534\65 /var/log > ls
ConsoleKit      auth.log    crond.2       daemon.log.4  everything.log           kdm.log       mail.log        messages.log.3    soundon.log   user.log.2
Xorg.0.log      auth.log.1  crond.3       dmesg.log     everything.log.1         kernel.log    mail.log.1      messages.log.4    syslog.log    user.log.3
Xorg.0.log.old  auth.log.2  crond.4       dspam         everything.log.2         kernel.log.1  mail.log.2      mpd               syslog.log.1  user.log.4
acpid.log       auth.log.3  cups          errors.log    everything.log.3         kernel.log.2  mail.log.3      old               syslog.log.2  wtmp
acpid.log.1     auth.log.4  daemon.log    errors.log.1  everything.log.4         kernel.log.3  mail.log.4      pacman.log        syslog.log.3  wtmp.1
acpid.log.2     btmp        daemon.log.1  errors.log.2  faillog                  kernel.log.4  messages.log    pm-powersave.log  syslog.log.4
acpid.log.3     crond       daemon.log.2  errors.log.3  gdm                      lastlog       messages.log.1  pm-suspend.log    user.log
acpid.log.4     crond.1     daemon.log.3  errors.log.4  interbench.loops_per_ms  lpr.log       messages.log.2  samba             user.log.1

toad@deskarch 534\66 /var/log > cat everything.log|grep mys

toad@deskarch 535\67 /var/log >

Basically I cannot find a log tongue

Okay, I checked /etc/group and found that no one belonged to mysql - added user mysql and myself. Am about to reboot (or is there a quicker way?), wish me luck smile

EDIT:
nope, will go through verbose et al again to see whether anything has changed...

Last edited by toad (2009-12-14 10:27:35)


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#6 2009-12-14 10:42:31

Deuterium
Member
Registered: 2009-09-26
Posts: 50

Re: [SOLVED] - mysqld won't start

some tips i got from here: http://www.linuxforums.org/forum/server … 002-a.html

try creating socket file.  Here's some code:

touch /var/lib/mysql/mysql.sock

and if the /var/lib/mysql directory doesnt exist yet, use this command first:

mkdir /var/lib/mysql

also, make sure the mysql.sock file can be written to.
now try starting the daemon.  If it didnt work, try starting the server first (just incase it isnt being started?)

safe_mysqld --user=mysql
#or
mysqld_safe --user=mysql

i got that command (above) from the url mentioned, and it looks like it needs the user mysql, so adding yourself to the mysql group seems like a good idea, let us know if it worked

Offline

#7 2009-12-14 17:53:38

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - mysqld won't start

I can't believe it!!!

I did a

sudo cp /etc/mysql/my.cnf /etc/my.cnf

and everything is working! Just looking in the wrong place all the time!

However, it does strike me as odd that this fact is not mentioned anywhere in the wiki or whatever. Will amend the former though to reflect this.

Who might have a say in where my.cnf file is located? Is it the arch package which puts it there by default? Is it worth telling the maintainer (Giovanni Scafora)?


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#8 2009-12-15 05:10:14

Deuterium
Member
Registered: 2009-09-26
Posts: 50

Re: [SOLVED] - mysqld won't start

was there a /etc/my.cnf file present before you copied it? maybe it was an incorrect configuration.  im not too sure on who to notify if something is actually wrong with it, just do whatever you think is apropriate.  btw, congratz on getting it working! smile

Offline

#9 2009-12-15 07:03:37

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] - mysqld won't start

nope, there wasn't...

I put something in the wiki by way of suggestion. It may help others, it may not. I am not qualified to write authoritatively on the subject smile


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#10 2009-12-21 01:17:29

kaismh
Member
From: Amman-Jordan
Registered: 2008-11-20
Posts: 12

Re: [SOLVED] - mysqld won't start

I had a similar problem, and solved it by removing mysql and installing it again. I used a Chakra live CD. maybe that is why it was corrupt.

Offline

#11 2010-01-27 00:14:38

Gallaecio
Member
From: Vigo (Spain)
Registered: 2009-04-10
Posts: 50
Website

Re: [SOLVED] - mysqld won't start

kaismh wrote:

I had a similar problem, and solved it by removing mysql and installing it again. I used a Chakra live CD. maybe that is why it was corrupt.

You are rigth. That's why it happend to me. I fixed it just with a:

# pacman -Rd mysql
# pacman -Sy mysql

Offline

Board footer

Powered by FluxBB