下载
https://downloads.mysql.com/archives/community/
安装依赖
sudo apt-get install libaio-dev
解压
tar xvf MysqL-5.7.19-linux-glibc2.12-x86_64.tar.gz -C /usr/local/ cd /usr/local/ ln -sv MysqL-5.7.19-linux-glibc2.12-x86_64/ MysqL useradd MysqL chown MysqL.MysqL /usr/local/MysqL -R mkdir /data/PRD/MysqL/5.7.19/my3306/{var,log,cnf,binlog,data} -p chown MysqL.MysqL -R /data/PRD/
准备配置文件
cat /etc/my.cnf
初始化数据库
/usr/local/MysqL/bin/MysqLd --defaults-file=/etc/my.cnf --initialize --user=MysqL --datadir=/data/PRD/MysqL/5.7.19/my3306/data/ --basedir=/usr/local/MysqL
启动
./MysqLd_safe --defaults-file=/etc/my.cnf &
登陆和关闭
ps -ef | grep MysqLd /usr/local/MysqL/bin/MysqL -uroot -p /usr/local/MysqL/bin/MysqLadmin shutdown -uroot -p /usr/local/MysqL/bin/MysqLd_safe --defaults-file=/etc/my.cnf &原文链接:https://www.f2er.com/ubuntu/349434.html