将客户机连接到MySQL Server机器 [英] Connecting Clients machine to MySQL Server machine

查看:128
本文介绍了将客户机连接到MySQL Server机器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两台机器。



机器1(服务器):安装了MySQL服务器。



机器2(客户端):安装了MySQL服务器





我想从机器2 (客户端)到机器1(服务器)上的MySQL服务器。



我在机器1(服务器)上执行了以下命令以授予所有客户端的权限:

  GRANT ALL ON *。* TO root @'%'IDENTIFIED BY'123456'; 

好吧,我需要从客户端连接MySQL服务器。



我在机器2(客户端)上的 cmd 中写了以下命令:

  mysql -h 192.168.0.1 -u root -p 

192.168.0.1上面的线是机器1(服务器)IP。



但出现以下错误:

 `mysql`不被识别为内部或外部命令,可操作的程序或批处理文件。 

我想需要安装类似mysql连接器或其他东西在机器2(客户端),isn'


解决方案

您可以使用其他工具与良好的GUI。例如:。






如果以上操作仍然不允许连接到MySQL。请确保防火墙不会阻止MySQL端口。


I've two machine.

Machine 1 (Server) : MySQL Server installed on it.

Machine 2 (Client) : MySQL Server not installed on it.


I would like connect from Machine 2 (Client) to MySQL Server on Machine 1 (Server).

I did following command on Machine 1 (Server) to grant permission to all clients :

GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '123456';

Well, I need to connect MySQL Server from Client.

I've write below command in cmd on Machine 2 (Client) :

mysql -h 192.168.0.1 -u root -p

192.168.0.1 on above line is Machine 1 (Server) IP.

But following error has occur :

`mysql` is not recognaized as an internal or external command, operable program or batch file.

I guess need to install something like mysql connector or something else on Machine 2 (Client), isn't it ?

解决方案

You can use other tool with good looking GUI. For example: HeidiSQL.


Then, you need to enable remote access. If you use windows, there is nice wizard for you to enable remote access with a few clicks. The wizard is located it at MySQL Server 5.5\bin\MySQLInstanceConfig.exe. Then Reconfigure Instance -> Next -> Standard Configuration -> Next -> Next. You will see this screen.

Tick on "Enable root access from remote machines". Or you can manually configure it to allow remote access from my.ini file. See this link for how to do it.


If having done above still does not allow you to connect to your MySQL. Please make sure that Firewall does not block MySQL port.

这篇关于将客户机连接到MySQL Server机器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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