简体   繁体   English

如何在同一局域网中连接另一台机器的本地MySQL数据库?

[英]How to connect local MySQL database of another machine in same LAN?

I have question about how to connect local mysql db of another machine in same LAN. 我有关于如何在同一局域网中连接另一台机器的本地mysql数据库的问题。 The scenario is we have 2 machines in LAN: 情况是我们在局域网中有2台机器:

     machine 1 :   
     IP                 : 127.0.0.1    
     local website name :  https://127.0.0.1/demo_project1  
     mysql db name      :  demo1      

     machine 2 :   
     IP : 127.0.0.2  
     local website name :  https://127.0.0.2/demo_project2  
     mysql db name      :  demo2    

Can we do make db connection of https://127.0.0.1/demo_project1 to https://127.0.0.2/demo_project ie demo2? 我们可以将https://127.0.0.1/demo_project1的数据库连接建立到https://127.0.0.2/demo_project,即demo2吗? It means both machine will working on same database. 这意味着两台机器将在同一个数据库上工作。

Note : 注意 :

  1. we have install on Xampp server on both machines. 我们已在两台机器上的Xampp服务器上安装。
  2. we can access https://127.0.0.2/demo_project2 of machine 2 from machine 1. 我们可以从机器1访问机器2的https://127.0.0.2/demo_project2

If the MySQL server is running in a machine which is connected to the same LAN where the second machine is connected, then you can access the MySQL server by specifying it's IP address. 如果MySQL服务器在连接到第二台计算机所连接的同一LAN的计算机上运行,​​则可以通过指定其IP地址来访问MySQL服务器。

You can find the IP (IPv4 address), by executing 'ifconfig' in the 'Command Prompt' (from the Start menu). 您可以通过在“命令提示符”(从“开始”菜单)中执行“ifconfig”来找到IP(IPv4地址)。

You can sync the data between the servers by creating a mysql dump and executing the same dump one the other server. 您可以通过创建mysql转储并在另一台服务器上执行相同的转储来同步服务器之间的数据。 You can automate this process using several MySQL client tools like SQLyog , MySQL Workbench, etc. which provides data sync option between two databases. 您可以使用SQLyog ,MySQL Workbench等几个MySQL客户端工具自动执行此过程,这些工具在两个数据库之间提供数据同步选项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从同一局域网中的另一台计算机连接mysql服务器 - How To Connect mysql server from another machine in same lan xampp-从局域网内的另一台本地计算机连接到本地数据库 - xampp - connecting to a local database from another local machine inside a LAN 如何将 Power BI Desktop 连接到本地计算机上的 MYSQL 数据库? - How to connect Power BI Desktop to MYSQL Database on my local Machine? 如何在ubuntu中使用相同的局域网将mysql数据库的访问权限授予另一台计算机? - How to give acces to mysql database to another computer using same lan in ubuntu? 无法连接到无线局域网上的本地MYSQL服务器 - Unable to connect to a local MYSQL server on wireles LAN 如何将本地计算机上的 MySQL 数据库设置连接到 Docker 上的 Apache Superset? - How do I connect MySQL Database setup on my local machine to Apache Superset on Dockers? Rails应用程序(在本地计算机上)可以在没有在本地计算机上设置mysql的情况下连接到远程数据库(在登台服务器上)吗? - Can a rails app (on local machine) connect to a remote database (on staging server) without having mysql setup on the local machine? Apache Windows 机器上的 NiFi 无法连接到同一主机上的 MySQL 数据库 - Apache NiFi on Windows machine failed to connect to MySQL database on same host 通过Java从另一台计算机连接到MySQL数据库 - Connect to MySQL database from another machine through java 如何从同一台机器上的另一个 docker 实例连接到 mySQL docker 实例 - How to connect to mySQL docker instance from another docker instance on the same machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM