startirai si mysqld de inache nqma da stane
touch /etc/rc.d/rc.mysqld
#!/bin/sh
# Start/stop/restart mysqld.
#
# Copyright 2003 Patrick J. Volkerding, Concord, CA
# Copyright 2003 Slackware Linux, Inc., Concord, CA
#
# This program comes with NO WARRANTY, to the extent
permitted by law.
# You may redistribute copies of this program under the
terms of the
# GNU General Public License.
# To start MySQL automatically at boot, be sure this
script is executable:
# chmod 755 /etc/rc.d/rc.mysqld
# To disallow outside connections to the database (if you
don't need them, this
# is recommended to increase security), uncomment the next
line:
#SKIP="--skip-networking"
# Start mysqld:
mysqld_start() {
if [ -x /usr/bin/safe_mysqld ]; then
# If there is an old PID file (no mysqld running),
clean it up:
if [ -r /var/run/mysql/mysql.pid ]; then
if ! ps ax | grep mysqld 1> /dev/null 2> /dev/null ;
then
echo "Cleaning up old /var/run/mysql/mysql.pid."
rm -f /var/run/mysql/mysql.pid
fi
fi
/usr/bin/safe_mysqld --datadir=/var/lib/mysql
--pid-file=/var/run/mysql/mysql.pid $SKIP &
fi
}
# Stop mysqld:
mysqld_stop() {
# If there is no PID file, ignore this request...
if [ -r /var/run/mysql/mysql.pid ]; then
killall mysqld
# Wait at least one minute for it to exit, as we don't
know how big the DB is...
for second in 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 \
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
6 7 8 9 60 ; do
if [ ! -r /var/run/mysql/mysql.pid ]; then
break;
fi
sleep 1
done
if [ "$second" = "60" ]; then
echo "WARNING: Gave up waiting for mysqld to exit!"
sleep 15
fi
fi
}
# Restart mysqld:
mysqld_restart() {
mysqld_stop
mysqld_start
}
case "$1" in
'start')
mysqld_start
;;
'stop')
mysqld_stop
;;
'restart')
mysqld_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
su mysql
mysql_create_db
exit
cd /etc
mv my-medium.cnf my.cnf
/etc/rc.d/rc.mysqld start
ps axf | grep mysqld
kiril@chaos:~$ ps axf | grep mysqld
142 ? S 0:00 /bin/sh /usr/bin/safe_mysqld
--datadir=/var/lib/mysql
--pid-file=/var/run/mysql/mysql.pid
169 ? S 0:00 \_ /usr/libexec/mysqld
--basedir=/usr --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/run/mysql/mysql.pid --skip-locking
171 ? S 0:00 \_ /usr/libexec/mysqld
--basedir=/usr --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/run/mysql/mysql.pid --skip-locking
172 ? S 0:00 \_ /usr/libexec/mysqld
--basedir=/usr --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/run/mysql/mysql.pid --skip-locking
28203 pts/0 S 0:00 \_ grep mysqld
|