MySQL(5.7)通过二进制文件安装的方式
2019-02-23 本文已影响0人
黑色汪汪汪
1:卸载残留数据库
2:安装缺少的包(for CentoOS6.9 mini)
numactl-2.0.9-2.el6.x86_64.rpm
3:根据文档编译安装数据库
# Preconfiguration setup
shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
# Beginning of source-build specific instructions
shell> tar zxvf mysql-VERSION.tar.gz
shell> cd mysql-VERSION
shell> mkdir bld
shell> cd bld
shell> cmake ..
shell> make
shell> make install
# End of source-build specific instructions
# Postinstallation setup
shell> cd /usr/local/mysql
shell> mkdir mysql-files
shell> chown mysql:mysql mysql-files
shell> chmod 750 mysql-files
shell> bin/mysqld --initialize --user=mysql
shell> bin/mysql_ssl_rsa_setup
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server
4:执行“shell> bin/mysqld --initialize --user=mysql ”的时候,留意一下提示的密码信息。
5:执行“bin/mysqld_safe --user=mysql &”之前,先改my.cnf文件。
6:登录数据库,修改默认密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';