iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >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://www.lsjlt.com/news/2056.html(转载时请注明来源链接)

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

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • sql中year是集函数吗
    否,year 不是 sql 中的聚合函数。year 函数是一个日期函数,用于从给定的日期值中提取年份。它是一个标量函数,返回单个值,而不是值的集合。相反,聚合函数对一组值进行操作并生成一...
    99+
    2024-05-15
    聚合函数
  • sql中between的用法
    sql 中 between 运算符用于检查值是否在指定范围之内,其语法为:select column_name from table_name where colum...
    99+
    2024-05-15
  • sql中update用法
    sql 中的 update 语句用于更新表中的现有数据,通过指定要更新的表、列、值和可选的更新条件来实现,可更新特定行或组行的特定列值。 SQL 中的 UPDATE 语句 什么是 UP...
    99+
    2024-05-15
  • sql中for循环的用法
    sql 中 for 循环可用于遍历结果集,逐行执行操作。语法:for var_name in (select_statement) [loop_statement] end f...
    99+
    2024-05-15
  • sql中any和all的区别
    sql 中 any 和 all 运算符的区别在于:any 检查子查询中是否存在满足条件的行,返回 true 或 false。all 检查子查询中所有行是否都满足条件,返回 true 或 ...
    99+
    2024-05-15
  • sql中exists具体用法
    exists 子查询用于检查外层查询中的行是否存在匹配记录,用法如下:包含在 select 语句的 where 子句中。返回布尔值 true (存在匹配) 或 fal...
    99+
    2024-05-15
  • sql中union用法
    union 运算符在 sql 中用来合并相同结构的表或子查询的结果集,排除重复行。它具有以下用法:合并具有相同列名和数据类型的多个表或子查询的结果集合并为一个。排除结果集中重复...
    99+
    2024-05-15
  • sql中索引的用法
    sql 中索引是一种通过创建数据指针来提高查询性能的技术,主要用于where、order by、join和group by子句。索引类型包括聚集索引、非聚集索引、主键索引、唯一...
    99+
    2024-05-15
    聚合函数
  • sql中nullif怎么用
    sql 中的 nullif() 函数,用于比较两个表达式并返回较小的值,若均为 null 则返回 null,语法为 nullif(expression1, expression2)。可用...
    99+
    2024-05-15
  • sql中decode用法
    decode 函数根据输入表达式值将值转换为另一个值,语法为 decode(expression, value1, result1, value2, result2, ..., defa...
    99+
    2024-05-15
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作