CentOS 8 安装MySQL 8
把下面四个rpm软件包放到指定目录并定位到那,执行如下命令: yum -y install mysql-community-common-8.0.18-1.el8.x86_64.rpm mysql-community-libs-8.0.18-1.el8.x86_64.rpm mysql-community-client-8.0.18-1.el8.x86_64.rpm mysql-community-server-8.0.18-1.el8.x86_64.rpm 即可安装成功。 启动:systemctl start mysqld.service 查看状态:systemctl status mysqld.service 查看初始密码:grep 'temporary password' /var/log/mysqld.log 登录:mysql -uroot -p 输入上面显示的密码 更改密码:ALTER USER 'root'@'localhost' IDENTIFIED BY '密码'; 关闭:systemctl stop mysqld.service 重启:systemctl restart mysqld.service 如需打开防火墙3306端口:firewall-cmd --zone=public --add-port=3306/tcp --permanent 生效:firewall-cmd --reload
还要把mysql-connector-java-8.0.18.jar放到Tomcat的lib文件夹里,否则会出错。下载教程点击此处
Last updated