mysql安装部署教程
时间: 2023-10-28 11:00:28 浏览: 100
MySQL的安装和部署可以按照以下步骤进行:
1)首先,下载并安装MySQL的安装包以及附件。可以使用以下命令进行下载和安装:
[root@localhost mysql]# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.32-1.el9.x86_64.rpm-bundle.tar
[root@localhost mysql]# tar xvf mysql-8.0.32-1.el9.x86_64.rpm-bundle.tar
[root@localhost mysql]# dnf localinstall mysql-community-server-8.0.32-1.el9.x86_64.rpm \
> mysql-community-client-8.0.32-1.el9.x86_64.rpm \
> mysql-community-common-8.0.32-1.el9.x86_64.rpm \
> mysql-community-icu-data-files-8.0.32-1.el9.x86_64.rpm \
> mysql-community-client-plugins-8.0.32-1.el9.x86_64.rpm \
> mysql-community-libs-8.0.32-1.el9.x86_64.rpm
2)登录MySQL并修改密码。使用以下命令登录MySQL并修改密码:
[root@localhost ~]# mysql -uroot -p
Enter password:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Admin123!';
mysql> show databases;
mysql> exit
3)开启MySQL服务并登录。使用以下命令开启MySQL服务并查看服务状态:
[root@localhost ~]# systemctl start mysqld #开启MySQL服务
[root@localhost ~]# systemctl status mysqld #查看MySQL服务
以上就是MySQL的安装部署教程。你可以根据这些步骤来安装和配置MySQL数据库。
阅读全文