wget -O /tmp/mysql-5.7.38.tar.gz https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz?spm=a2c6h.25603864.0.0.42df63afg9UZlH
curl -o /tmp/mysql-5.7.38.tar.gz https://mirrors.aliyun.com/mysql/MySQL-5.7/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz?spm=a2c6h.25603864.0.0.42df63afg9UZlH
#解决ubuntu下mysql执行报错
yum 或者 apt-get install libncurses*
shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> tar -zxvf /tmp/mysql-5.7.38.tar.gz
shell> mv /tmp/mysql-5.7.38-linux-glibc2.12-x86_64 /srv/mysql5.7
shell> ln -s /srv/mysql5.7 /usr/local/mysql
shell> ln -s /srv/mysql5.7/bin/mysql /usr/bin/mysql
shell> chown -R mysql /srv/mysql5.7
shell> chgrp -R mysql /srv/mysql5.7
shell> /srv/mysql5.7/bin/mysqld --initialize --user=mysql --datadir=/srv/mysql5.7/data 2>&1|tee> /srv/mysql5.7/init.log
shell> chown -R root /srv/mysql5.7
shell> chown -R mysql /srv/mysql5.7/data
shell> cp /srv/mysql5.7/support-files/mysql.server /etc/init.d/mysql.server
shell> /srv/mysql5.7/bin/mysqld_safe --user=mysql &
shell> service start mysql.server
# 初始密码请查看安装日志
shell> cat /srv/mysql5.7/init.log
标签:全系,shell,tar,5.7,mysql5.7,linux,srv,mysql From: https://blog.51cto.com/u_197690/5847759