黑马linux安装mysql
时间: 2023-10-17 08:34:11 浏览: 191
要在黑马Linux上安装MySQL,可以按照以下步骤进行操作:
1. 首先,在终端中运行以下命令以创建MySQL目录:
```shell
mkdir /usr/local/mysql
```
2. 然后,将下载的MySQL安装包解压到该目录下:
```shell
tar -zxvf mysql-5.7.25-1.el7.x86_64.rpm-bundle.tar.gz -C /usr/local/mysql
```
3. 接下来,启动MySQL服务并设置开机自启动:
```shell
systemctl start mysqld
systemctl enable mysqld
```
4. 确认MySQL服务已经成功启动,可以运行以下命令检查服务状态:
```shell
systemctl status mysqld
```
5. 如果需要查看MySQL监听的端口,可以运行以下命令:
```shell
netstat -tunlp | grep mysql
```
6. 最后,安装MySQL的依赖包和客户端:
```shell
cd /usr/local/mysql
rpm -ivh mysql-community-common-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.25-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.25-1.el7.x86_64.rpm
yum install net-tools
rpm -ivh mysql-community-server-5.7.25-1.el7.x86_64.rpm
```
请注意,以上步骤是在黑马Linux上安装MySQL的基本过程。具体安装过程可能会因系统环境和版本而有所差异,请根据实际情况进行操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [【Linux虚拟机】Cent OS 下安装 MySQL 流程](https://blog.csdn.net/qq_39473176/article/details/128832846)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)