连接到本地网络上的MySQL数据库 [英] Connect to MySQL Database on Local Network

查看:129
本文介绍了连接到本地网络上的MySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实际上以为可以尝试,直到尝试为止.我在本地网络IP地址(192.168.1.4)的一台PC上安装了MySQL服务器,现在我试图从同一网络(192.168.1.5)的另一台PC上访问它,但是我无法:

I actually thought I could do this until I tried. I installed MySQL server on one PC in the Local network IP Address (192.168.1.4) and now I am trying to access it from another PC in the same network (192.168.1.5) but I am unable:

C:\Users\DOMICO>mysql -u domico -h 192.168.1.4 -p
Enter password: **********
ERROR 1045 (28000): Access denied for user 'domico'@'DOMICO-PC' (using password:
 YES)

令人惊讶的是,DOMICO-PC是我要连接的PC.为什么它不连接到给定的主机,而是尝试连接到本地计算机?

Surprisingly DOMICO-PC is the PC I am trying to connect from. Why is it not connecting to the given host but trying to connect to Local machine?

推荐答案

您需要授予从remotehost连接的权限

You need to give permissions to connect from remotehost

mysql>将所有特权授予数据库.*以'password'身份以'GRANT OPTION'标识为'username'@'%';

mysql>GRANT ALL PRIVILEGES ON database.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

这篇关于连接到本地网络上的MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆