在Ubuntu18安装mysql8,你可以全程复制下面的命令和操作,基本不会失败,下载文件连接可能会失效,失效的话,重新找他的tar文件即可。
【搜狐镜像】,下载速度大概250KB
wget http://mirrors.sohu.com/mysql/MySQL-8.0/mysql-server_8.0.20-1ubuntu18.04_amd64.deb-bundle.tar
【华中镜像】
如果你网速够快,应该不用1分钟就可以下载完毕。
wget https://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-8.0/mysql-server_8.0.21-1ubuntu20.04_amd64.deb-bundle.tar
tar xvf mysql-server_8.0.20-1ubuntu18.04_amd64.deb-bundle.tar
rm mysql-community-test-debug_8.0.20-1ubuntu18.04_amd64.deb
rm mysql-testsuite_8.0.20-1ubuntu18.04_amd64.deb
rm mysql-community-test_8.0.20-1ubuntu18.04_amd64.deb
rm mysql-community-server-debug_8.0.20-1ubuntu18.04_amd64.deb
linux表区分大小写问题解决
sudo debconf-set-selections <<< "mysql-server mysql-server/lowercase-table-names select Enabled"
sudo dpkg -i *.deb
sudo apt update
sudo apt upgrade
sudo apt-get -f -y install
密码选择8风格还是5,你自行决定,这里选择了5.
假定密码为root。
mysql -u root -p
输入 root
show variables where Variable_name='lower_case_table_names';
user mysql
update user set host='%' where user ='root';
FLUSH PRIVILEGES;
如果需要修改配置,自行修改 /etc/mysql/mysql.conf.d/mysqld.cnf
即可。
service mysql stop
service mysql start
dpkg --list|grep mysql
把查询到的都卸载
sudo apt-get autoremove --purge libmysqlclient-dev libmysqlclient21:amd64 mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-server mysql-community-server-core mysql-server
信息加载中,请等待
微信客服(速回)
微信客服(慢回)