数据库
首页 > 数据库> > ubuntu16安装mysql8

ubuntu16安装mysql8

作者:互联网

1、上传文件

mysql8deb.tar: 126邮箱下载

# cat mysql8install.sh
#!/bin/bash
echo -e "\033[32mMySQL 8.0.23 begin install...\033[0m"
basedir=$(cd $(dirname $0);pwd)
debs=(
mysql-common_8.0.23-1ubuntu16.04_amd64.deb
mysql-community-client-plugins_8.0.23-1ubuntu16.04_amd64.deb
mysql-community-client-core_8.0.23-1ubuntu16.04_amd64.deb
mysql-community-client_8.0.23-1ubuntu16.04_amd64.deb
mysql-client_8.0.23-1ubuntu16.04_amd64.deb
libmysqlclient21_8.0.23-1ubuntu16.04_amd64.deb
libmysqlclient-dev_8.0.23-1ubuntu16.04_amd64.deb
libaio1_0.3.110-2_amd64.deb
libmecab2_0.996-1.2ubuntu1_amd64.deb
mysql-community-server-core_8.0.23-1ubuntu16.04_amd64.deb
mysql-community-server_8.0.23-1ubuntu16.04_amd64.deb
)
mkdir $basedir/mysqldebs
tar xf mysql8deb.tar -C $basedir/mysqldebs
dpkg-preconfigure $basedir/mysqldebs/${debs[10]}
for ((i=0;i<${#debs[*]};i++)); do
    dpkg -i $basedir/mysqldebs/${debs[i]}
done
rm -rf $basedir/mysqldebs
echo -e "\033[32mMySQL 8.0.23 install complete! \033[0m"
echo -e "\033[32mMySQL 8.0.23 begin set character...\033[0m"
echo "character-set-server=utf8" >> /etc/mysql/mysql.conf.d/mysqld.cnf
systemctl restart mysql
systemctl enable mysql
echo -e "\033[32mMySQL 8.0.23 can use now! \033[0m"

2、切换root权限

3、执行安装脚本

4、配置mysql的root密码

标签:8.0,amd64,23,mysql8,1ubuntu16.04,mysql,ubuntu16,deb,安装
来源: https://www.cnblogs.com/ly447742/p/14538869.html