• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Mysql woes

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> UNIX // GNU/Linux

View previous topic :: View next topic  
Author Message
DJ-Q
Just Arrived
Just Arrived


Joined: 18 Nov 2002
Posts: 0
Location: Cardiff

Offline

PostPosted: Wed Apr 02, 2003 12:33 pm    Post subject: Mysql woes Reply with quote

I have compiled mysql 4.0.12 on my Debian Woody server. I have created the tables using
Code:
./scripts/mysql_install_db
but when i try to start mysqld up using
Code:
./bin/mysqld_safe --user=mysql &
it starts and ends immediatley saying :
Code:
naboo:/usr/local/mysql/bin# ./mysqld_safe --user=mysql &
[1] 224
naboo:/usr/local/mysql/bin# Starting mysqld daemon with databases from /usr/local/mysql/var
030402 12:26:19  mysqld ended


[1]+  Done                    ./mysqld_safe --user=mysql


The message in host.err is :

Code:
030402 12:14:12  mysqld started
030402 12:14:12  InnoDB: Operating system error number 13 in a file operation.
InnoDB: See http://www.innodb.com/ibman.html for installation help.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: Cannot continue operation.
030402 12:14:12  mysqld ended


Does anybody know what directory or file this is talking about and what access rights it/they should be set at?
Back to top
View user's profile Send private message
ShaolinTiger
Forum Fanatic
Forum Fanatic


Joined: 18 Apr 2002
Posts: 16777215
Location: Kuala Lumpur, Malaysia

Offline

PostPosted: Wed Apr 02, 2003 12:37 pm    Post subject: Reply with quote

Make sure mysqld has permissions to create InnoDB data and log files to
datadir of MySQL..
Back to top
View user's profile Send private message Visit poster's website
DJ-Q
Just Arrived
Just Arrived


Joined: 18 Nov 2002
Posts: 0
Location: Cardiff

Offline

PostPosted: Wed Apr 02, 2003 12:40 pm    Post subject: Reply with quote

what is mysql datadir? is it /usr/local/mysql/var?
Back to top
View user's profile Send private message
ShaolinTiger
Forum Fanatic
Forum Fanatic


Joined: 18 Apr 2002
Posts: 16777215
Location: Kuala Lumpur, Malaysia

Offline

PostPosted: Wed Apr 02, 2003 12:50 pm    Post subject: Reply with quote

Dunno wherever you installed it?

Usually do it with --datadir=/home/mysql or whatever so I don't know where it goes by default.

I think it's /var/lib/mysql

You can find some info on setting up here:

http://www.flatmtn.com/computer/Linux-mySQL.html

The below script should set correct permissions:

Code:
#!/bin/bash
#
# mysqld        This shell script takes care of starting and stopping
#               the MySQL subsystem (mysqld).
#
# chkconfig: - 78 12
# description:  MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

prog="MySQL"

datadir="/var/lib/mysql"

start(){
       touch /var/log/mysqld.log
        chown mysql.mysql /var/log/mysqld.log
        chmod 0640 /var/log/mysqld.log
        if [ ! -d $datadir/mysql ] ; then
            action $"Initializing MySQL database: " /usr/bin/mysql_install_db
            ret=$?
            chown -R mysql.mysql $datadir
            if [ $ret -ne 0 ] ; then
                return $ret
            fi
        fi
        chown -R mysql.mysql $datadir
        chmod 0755 $datadir
        /usr/bin/safe_mysqld  --defaults-file=/etc/my.cnf >//[b][/b]dev[b][/b]/null 2>&1 &
        ret=$?
        if [ $ret -eq 0 ]; then
            action $"Starting $prog: " /bin/true
        else
            action $"Starting $prog: " /bin/false
        fi
        [ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
        return $ret
}

stop(){
        /bin/kill `cat /var/run/mysqld/mysqld.pid  2> //[b][/b]dev[b][/b]/null ` > //[b][/b]dev[b][/b]/null 2>
        ret=$?
        if [ $ret -eq 0 ]; then
            action $"Stopping $prog: " /bin/true
        else
            action $"Stopping $prog: " /bin/false
        fi
        [ $ret -eq 0 ] && rm -f /var/lock/subsys/mysqld
        [ $ret -eq 0 ] && rm -f $datadir/mysql.sock
        return $ret
}

restart(){
    stop
    start
}

condrestart(){
    [ -e /var/lock/subsys/mysqld ] && restart || :
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  status)
    status mysqld
    ;;
  restart)
    restart
    ;;
  condrestart)
    condrestart
    ;;
  *)
    echo $"Usage: $0 {start|stop|status|condrestart|restart}"
    exit 1
esac

exit $?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> UNIX // GNU/Linux All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register