时间:2021-07-01 10:21:17 帮助过:53人阅读
# 创建数据库
# cd /opt
# cd /opt/mysql/mysql-5.6.17-linux-glibc2.5-x86_64
# scripts/mysql_install_db --user=mysql
创建实例目录
# mkdir -p /opt/mysql/server0/log
# mkdir -p /opt/mysql/server0/run
# cp -R data /opt/mysql/server0
# cp my.cnf /opt/mysql/server0
配置启动参数
# cd /opt/mysql/server0
# vi my.cnf
[mysqld_safe]
basedir=/opt/mysql/mysql-5.6.17-linux-glibc2.5-x86_64
datadir=/opt/mysql/server0/data
log-error=/opt/mysql/server0/log/error.log
socket=/tmp/mysql_server0.sock
# cd /opt
# chmod -R mysql:dba mysql
启动mysql
$ export $MYSQL_BASE=/opt/mysql/mysql-5.6.17-linux-glibc2.5-x86_64
$ $MYSQL_BASE/bin/mysqld_safe --defaults-files=/opt/mysql/server0/my.cnf --ledir=$MYSQL_BASE/bin --user=mysql