Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi Have installed mysql 4.0.21 on red hat 8.0 and all seems ok until I try to run the server with ./bin/myslqd_safe & gives Starting mysqld daemon with databases from ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    ian
    ian is offline
    Just Joined!
    Join Date
    Nov 2002
    Location
    Cambs Uk
    Posts
    31

    Mysql server exiting immediately


    Hi

    Have installed mysql 4.0.21 on red hat 8.0 and all seems ok until I try to run the server with

    ./bin/myslqd_safe &

    gives
    Starting mysqld daemon with databases from /var/lib/mysql
    STOPPING server from pid file /var/run/mysqld/mysqld.pid
    040920 12:58:20 mysqld ended

    I cannot find this pid file - any ideas why it is stopping the server?

    Ta

  2. #2
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Have you tried running it as root?
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  3. #3
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    Check the logs in /var/log and see what they say.

  4. #4
    ian
    ian is offline
    Just Joined!
    Join Date
    Nov 2002
    Location
    Cambs Uk
    Posts
    31
    Yes Im running it as root.

    Ive checked the log and im getting(with date and time)

    mysqld started
    Warning: Asked for 196608 thread stack, but got 126976
    Can't start server : Bind on unix socket: Permission denied
    Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock
    Aborting
    Shutdown complete

    There does seem to be a previous version installed, but If i do a ps -augx I cannot see any mysql demons running.

  5. #5
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    How did you install yours?

  6. #6
    ian
    ian is offline
    Just Joined!
    Join Date
    Nov 2002
    Location
    Cambs Uk
    Posts
    31
    I used mysql-standard-4.0.21-pc-linux-i686 from mysql.com

    copied it to /tmp directory

    groupadd mysql
    useradd -g mysql mysql

    changed to /usr/local (as recommended by book managind and using Mysql by orielly)

    cd /usr/local

    unpacked

    gunzip -c /tmp/mysql-standard-4.0.21-pc-linux-i686.tar.gz | tar -xf-

    created symbolic link
    ln -s mysql-standard-4.0.21-pc-linux-i686 mysql

    then did

    scripts/mysql_install_db
    chown -R root /usr/local/mysql
    chgrp -R mysql /usr/local/mysql
    chown -R mysql /usr/local/mysql/data

    finally tried to start server
    bin/safe_mysqld --user=mysql &

    Any help?

  7. #7
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    Did you su to mysql user when running
    Code:
    scripts/mysql_install_db
    if you did not this is the problem. You need to su to mysql user and re run the script then it will work (you might need to remove the contents of /var/lib/mysql? Try it without first!). The problem is you created all the database files as user root so when mysqld starts as user mysql then theres a permissions problem.

  8. #8
    ian
    ian is offline
    Just Joined!
    Join Date
    Nov 2002
    Location
    Cambs Uk
    Posts
    31
    No I didnt do that so I have done it now, but I got the same errors. I tried starting the server as root and that has worked !

    Guess this is not a good thing.

  9. #9
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    No dont run it as root, Whats the permissions on /var/lib/mysql and its contents?

  10. #10
    ian
    ian is offline
    Just Joined!
    Join Date
    Nov 2002
    Location
    Cambs Uk
    Posts
    31
    Permissions are

    drwxr-xr-x 4 root mysql 4096 Sep 21 11:54 mysql/

    in mysql

    drwx------ 2 root mysql 4096 Sep 20 11:00 ./
    drwxr-xr-x 4 root mysql 4096 Sep 21 11:54 ../
    -rw-rw---- 1 root mysql 8778 Sep 20 11:00 columns_priv.frm
    -rw-rw---- 1 root mysql 0 Sep 20 11:00 columns_priv.MYD
    -rw-rw---- 1 root mysql 1024 Sep 20 11:00 columns_priv.MYI
    -rw-rw---- 1 root mysql 8982 Sep 20 11:00 db.frm
    -rw-rw---- 1 root mysql 302 Sep 20 11:00 db.MYD
    -rw-rw---- 1 root mysql 3072 Sep 20 11:00 db.MYI
    -rw-rw---- 1 root mysql 8641 Sep 20 11:00 func.frm
    -rw-rw---- 1 root mysql 0 Sep 20 11:00 func.MYD
    -rw-rw---- 1 root mysql 1024 Sep 20 11:00 func.MYI
    -rw-rw---- 1 root mysql 8958 Sep 20 11:00 host.frm
    -rw-rw---- 1 root mysql 0 Sep 20 11:00 host.MYD
    -rw-rw---- 1 root mysql 1024 Sep 20 11:00 host.MYI
    -rw-rw---- 1 root mysql 8877 Sep 20 11:00 tables_priv.frm
    -rw-rw---- 1 root mysql 0 Sep 20 11:00 tables_priv.MYD
    -rw-rw---- 1 root mysql 1024 Sep 20 11:00 tables_priv.MYI
    -rw-rw---- 1 root mysql 9148 Sep 20 11:00 user.frm
    -rw-rw---- 1 root mysql 428 Sep 20 11:00 user.MYD
    -rw-rw---- 1 root mysql 2048 Sep 20 11:00 user.MYI

Page 1 of 2 1 2 LastLast

Posting Permissions

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