ubuntu 16.04 和 windows 10系统安装mysql 允许远程访问 | mysql user guide on ubuntu 16.04 and windows 10

Posted kezunlin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu 16.04 和 windows 10系统安装mysql 允许远程访问 | mysql user guide on ubuntu 16.04 and windows 10相关的知识,希望对你有一定的参考价值。

本文首发于个人博客https://kezunlin.me/post/36e618e7/,欢迎阅读!

mysql user guide on ubuntu 16.04 and windows 10

Part-1: Ubuntu

install

sudo apt-get install mysql-server
# root,123456

mysql -uroot -p123456

allow remote access

change bind-address

cd /etc/mysql
grep -r \'bind-address\' .
./mysql.conf.d/mysqld.cnf:bind-address          = 127.0.0.1

change bind-address to 0.0.0.0

vim ./mysql.conf.d/mysqld.cnf
bind-address          = 0.0.0.0

# or 
sed -i \'s/127.0.0.1/0.0.0.0/g\' /etc/mysql/mysql.conf.d/mysqld.cnf

# restart
service mysql restart

grant users

mysql> grant all privileges on *.* to \'root\'@\'%\' identified by \'123456\' with grant option;
mysql> flush privileges;

check for users.

mysql> use mysql;
mysql> select user,host from user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| root             | %         |
| debian-sys-maint | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
5 rows in set (0.00 sec)

OK. Now we can access mysql from remote machine.

Test connection

mysql -uroot -p123456 -h 192.168.0.130

Part-2: Windows

install mysql server 5.7

OK

allow remote access

grant users

mysql> grant all privileges on *.* to \'root\'@\'%\' identified by \'123456\' with grant option;
mysql> flush privileges;

close fireware

close fireware and allow 3306 tcp connection.

Test connection

mysql -uroot -p123456 -h 192.168.0.130

or by mysql client.

Reference

History

  • 20180124: created.
  • 20180308: add windows part.

Copyright

以上是关于ubuntu 16.04 和 windows 10系统安装mysql 允许远程访问 | mysql user guide on ubuntu 16.04 and windows 10的主要内容,如果未能解决你的问题,请参考以下文章

windows10和ubuntu16.04双系统下时间不对的问题

windows10和ubuntu16.04双系统下时间不对的问题

windows10和ubuntu16.04双系统下时间不对的问题

ubuntu16.04环境下重装windows10

ubuntu16.04下安装windows10(傻瓜式)

Windows 10 和 Linux Ubuntu 16.04 在运行时间上的巨大差异,用于 ExtraTreesClassifier 训练和预测 (Python)