From fb866dd5f2f477dce3e206793309166bb5a24b6c Mon Sep 17 00:00:00 2001 From: EagleYing Date: Sun, 20 Jan 2019 20:35:28 +0800 Subject: [PATCH] macOS\MySQL\Workbench --- Remote Connection MySQL by Workbench.md | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Remote Connection MySQL by Workbench.md diff --git a/Remote Connection MySQL by Workbench.md b/Remote Connection MySQL by Workbench.md new file mode 100644 index 0000000..b7c7fe0 --- /dev/null +++ b/Remote Connection MySQL by Workbench.md @@ -0,0 +1,29 @@ +# Remote Connection MySQL by Workbench + +### Basics + +Firstly you need MySQL server and MySQLWorkbench, I suggest a quite stable version [MySQL 5.7](https://dev.mysql.com/downloads/mysql/5.7.html#downloads). As for Workbench I suggest [MySQLWorkbench 6.3](https://downloads.mysql.com/archives/workbench/) because higher version may cause compatibility issues. + +### Configure remote connection for MySQL + +Edit `mysql.cnf`, I found `mysqld.cnf` under`/etc/mysql/mysql.conf.d`, find `bind-address = 127.0.0.1` and comment it out + +`#bind-address = 127.0.0.1` + +On your server, `mysql -u username -p` + +Add new mysql user + +`GRANT ALL ON *.* to user@'IP' IDENTIFIED BY 'password'; ` + +'IP' I suggest use '%' which means allow all ip connections. Then refresh system + +`FLUSH PRIVILEGES;` + +`exit` and restart the mysql service + +`sudo service mysql restart ` + +### Operate Workbench + +Click the plus button on the home page, fill in the server IP address, username, password(your mysql password on server), wish you success! \ No newline at end of file