MySQL 5.7 安装
安装/启动
解压
# cd /usr/local/src/
# tar xf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
# mv mysql-5.7.18-linux-glibc2.5-x86_64 /usr/local/mysql57
软链
# cd /usr/local
# ln -s /usr/local/mysql57 mysql
初始化,注意初始化完成后返回的临时root登录密码
# cd /usr/local/mysql
# mkdir -p /data/dbfile
# mkdir mysql.files
# ./bin/mysqld --initalize --user=mysql --datadir=/data/dbfile
# ./bin/mysql_ssl_rsa_setup --datadir=/data/dbfile
# chown -R mysql.mysql data mysql.files
启动
# cp support-files/mysql.server /etc/init.d/mysql57
# chmod +x /etc/init.d/mysql57
# chkconfig --add mysql57
# chkconfig mysql57 on
# /etc/init.d/mysql57 start
登录
# mysql -p临时密码
# mysql> set password=password('123123');
排错
多
my.cnf
问题/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
看日志,
data/hostname.err