---
title: "开启MySQL远程访问权限 允许远程连接"
author: "improve"
date: "2012-09-12T15:32:02Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2012-09-12T15:32:02Z"
id: 1676888
url: "https://improve.iteye.com/blog/1676888"
---

```
mysql> use mysql;
Database changed
mysql> grant all privileges  on *.* to root@'%' identified by "密码";
--%是表示所有的远程机器,如果指定单台此处写成ip
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;

--查看用户情况
mysql> select host,user,password from user;
```