Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Can't start server: can't create PID file

  1. #1
    Join Date
    Dec 2008
    Location
    Reno, Nevada
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Can't start server: can't create PID file

    So I seek the wisdom of the masses.

    Trying to start MySQL up and it says failed...
    /etc/init.d/mysqld start
    Timeout error occurred trying to start MySQL Daemon.
    Starting MySQL: [FAILED]

    Immediately *** is stamped on my forehead.

    To find out why I run, tail -f /var/log/mysqld.log:
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    090210 15:54:02 InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 43655.
    InnoDB: Doing recovery: scanned up to log sequence number 0 43655
    090210 15:54:02 InnoDB: Started; log sequence number 0 43655
    090210 15:54:02 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
    090210 15:54:02 [ERROR] Can't start server: can't create PID file: Permission denied
    090210 15:54:02 mysqld ended

    1. The user MySQL does in fact exist in the passwd file.
    2. The folder /var/run/mysqld is 755 and mysql:root
    3. I am doing all of this as Root.
    4. uname -a: Linux ***** 2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 12:03:43 EST 2008 i686 i686 i386 GNU/Linux
    5. cat /etc/my.cnf:
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1
    6.Permissions for /usr/libexec/mysqld:
    rwxr-xr-x 1 root root 7308960 May 25 2008 mysqld
    7. rpm -qa | grep mysql
    mysql-5.0.45-7.el5
    mysql-server-5.0.45-7.el5
    php-mysql-5.1.6-20.el5_2.1


    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    Where do I go from here?
    [Just realized I posted this in the wrong section. Sorry about that.]
    Last edited by SterLo; February 11th, 2009 at 01:49 AM. Reason: Adding more information.

  2. #2
    Join Date
    Aug 2008
    Location
    KwaZulu Natal, ZA
    Beans
    185
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Can't start server: can't create PID file

    Try:

    Code:
    sudo chgrp mysql /var/run/mysqld/
    sudo chmod g+w /var/run/mysqld/
    It might also need you to change the permissions of the PID file itself. If so:

    Code:
    sudo chgrp mysql /var/run/mysqld/mysqld.pid
    sudo chmod g+w /var/run/mysqld/mysqld.pid
    Registered Ubuntu user # 24327

  3. #3
    Join Date
    Dec 2008
    Location
    Reno, Nevada
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't start server: can't create PID file

    Thank you Beno,

    But alas - no luck.
    [root@*****libexec]# sudo chgrp mysql /var/run/mysqld/
    [root@*****libexec]# sudo chmod g+w /var/run/mysqld/
    [root@*****libexec]# /etc/init.d/mysqld start
    Timeout error occurred trying to start MySQL Daemon.
    Starting MySQL: [FAILED]

    Also, /var/run/mysqld/mysqld.pid doesn't exist...
    Do I need to create it?
    I was expecting that the script was already trying to create it.

    Am I wrong?

    I checked on my other servers that have MySQL working fine...they don't have mysqld.pid - not sure what that means.
    I tried creating it...then I ran /etc/init.d/mysql start...then it vanished.
    So I am thinking it doesn't exist until the script runs (process ID would only be of use then right?).

    Quote Originally Posted by beno1990 View Post
    Try:

    Code:
    sudo chgrp mysql /var/run/mysqld/
    sudo chmod g+w /var/run/mysqld/
    It might also need you to change the permissions of the PID file itself. If so:

    Code:
    sudo chgrp mysql /var/run/mysqld/mysqld.pid
    sudo chmod g+w /var/run/mysqld/mysqld.pid
    Last edited by SterLo; February 11th, 2009 at 01:46 AM. Reason: More information.

  4. #4
    Join Date
    Aug 2008
    Location
    KwaZulu Natal, ZA
    Beans
    185
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Can't start server: can't create PID file

    Has the error shown by tail -f /var/log/mysqld.log changed since you changed the permissions on the folder?
    Registered Ubuntu user # 24327

  5. #5
    Join Date
    Dec 2008
    Location
    Reno, Nevada
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't start server: can't create PID file

    tail -f /var/log/mysqld.log
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    090210 16:27:53 InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 43655.
    InnoDB: Doing recovery: scanned up to log sequence number 0 43655
    090210 16:27:53 InnoDB: Started; log sequence number 0 43655
    090210 16:27:53 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
    090210 16:27:53 [ERROR] Can't start server: can't create PID file: Permission denied
    090210 16:27:53 mysqld ended

    Quote Originally Posted by beno1990 View Post
    Has the error shown by tail -f /var/log/mysqld.log changed since you changed the permissions on the folder?

  6. #6
    Join Date
    Aug 2008
    Beans
    285
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't start server: can't create PID file

    Maybe try creating the file and giving the proper permissions?

    touch /var/run/mysqld/mysqld.pid
    chown mysql:mysql /var/run/mysqld/mysqld.pid

  7. #7
    Join Date
    Dec 2008
    Location
    Reno, Nevada
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't start server: can't create PID file

    Already tried that.
    I create the file and then run MySQL...then it bombs...and then the file is gone.

    A PID file just has a number in it...so I think it's created on the fly.

    Like I said - I checked on other servers and it isn't in existence...me thinks that

    [root@***** ~]# touch /var/run/mysqld/mysqld.pid
    [root@***** ~]# chown mysql:mysql /var/run/mysqld/mysqld.pid
    [root@***** ~]# /etc/init.d/mysqld start
    Timeout error occurred trying to start MySQL Daemon.
    Starting MySQL: [FAILED]
    [root@***** ~]# ls /var/run/mysqld/
    [root@***** ~]#


    Quote Originally Posted by y@w View Post
    Maybe try creating the file and giving the proper permissions?
    Last edited by SterLo; February 11th, 2009 at 06:03 PM. Reason: More information.

  8. #8
    Join Date
    Aug 2008
    Beans
    285
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't start server: can't create PID file

    mysql isn't zombied is it?

  9. #9
    Join Date
    Dec 2008
    Location
    Reno, Nevada
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't start server: can't create PID file

    Nope:

    [root@***** ~]# ps aux | awk '{ print $8 " " $2 }' | grep -w Z
    [root@***** ~]#


    Quote Originally Posted by y@w View Post
    mysql isn't zombied is it?

  10. #10
    Join Date
    Dec 2008
    Location
    Reno, Nevada
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't start server: can't create PID file

    For some reason it has just started working...for no reason as far as I can tell.

    Looks like someone else in the office took a look at it and figured it out.

    They said it was a permissions issue in the /var/run folder.

    BAH!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •