> For the complete documentation index, see [llms.txt](https://xiaoxiami.gitbook.io/swoole/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xiaoxiami.gitbook.io/swoole/swoole-ji-chu/yi-bu-fei-du-sai-io/yi-bu-mysql.md).

# 异步Mysql

建议先阅读官方文档[异步MySQL客户端](https://wiki.swoole.com/wiki/page/517.html)章节

> 注意:必须等待返回结果后才能执行下一条SQL

## 附录：mysql快速安装

下载源

```
wget -i http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
```

安装rpm源

```
rpm -ivh mysql57-community-release-el7-7.noarch.rpm
```

安装服务器

```
yum -y install mysql-community-server
```

启动数据库

```
systemctl  start  mysqld.service
```

获取随机密码

```
grep "password" /var/log/mysqld.log
```

登录mysql

修改密码

```
alter user 'root'@'localhost' identified by 'Root!!2019';
```

刷新权限

```
flush privileges
```
