LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1188|回复: 5

slackware 9.1用full安装后,怎么启动mysql?

[复制链接]
发表于 2003-10-27 15:44:24 | 显示全部楼层 |阅读模式
我用
/usr/bin/mysql_install_db
/usr/bin/mysqld_safe &
但是不行.

再用
groupadd mysql
发现mysql组,已经有了.

不知道该怎么弄
查看/var/lib/mysql/slackware.err发现
Fatal error:Can't open privilege tables: Cant't find file:'.mysql/host.frm' (errno: 13)
Aborting

希望各位兄弟帮帮我.
发表于 2003-10-27 18:15:12 | 显示全部楼层
full已经安装好了mysql
修改/etc/rc.d里面mysql的启动脚本,chmod +x
发表于 2003-10-28 08:45:13 | 显示全部楼层
我也是FULL安装的9.0好象rc.d里没有mysql的脚本吧,自己写?
发表于 2003-10-28 10:10:52 | 显示全部楼层
#cp /etc/my-medium.cnf my.cnf
#su mysql
mysql@kitelau:~$mysql_install_db
mysql@kitelau:~$exit
#cd /usr/;/usr/bin/mysql_safe &

OK?
发表于 2003-10-28 20:22:29 | 显示全部楼层
9.1里面已经有mysql的起动脚本了。
#/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

# Before you can run MySQL, you must have a database.  To install an initial
# database, do this as root:
#
#   su - mysql
#   mysql_install_db
#
# Note that step one is becoming the mysql user.  It's important to do this
# before making any changes to the database, or mysqld won't be able to write
# to it later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').

# 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/mysqld_safe ]; 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/mysqld_safe --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
 楼主| 发表于 2003-10-29 12:35:12 | 显示全部楼层
最初由 kite 发表
#cp /etc/my-medium.cnf my.cnf
#su mysql
mysql@kitelau:~$mysql_install_db
mysql@kitelau:~$exit
#cd /usr/;/usr/bin/mysql_safe &

OK?


问题解决了.
一定要su mysql
mysql_install_db
才可以.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表