返回顶部
首页 > 资讯 > 数据库 >ubuntu 16.04 和 windows 10系统安装mysql 允许远程访问 | mysql user guide on ubuntu 16.04 and windows 10
  • 569
分享到

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

本文首发于个人博客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

  • mysql guide
  • mysql remote access
  • mysql on windows remote access

History

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

Copyright

  • Post author: kezunlin
  • Post link: https://kezunlin.me/post/36e618e7/
  • Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.
您可能感兴趣的文档:

--结束END--

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

本文链接: https://lsjlt.com/news/2056.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作