Data sync between two local Mysql databases in different system in same netwrok
You need MySQL replication.
Here is the official documentation https://dev.mysql.com/doc/refman/8.0/en/replication.html
I like to use step by step guides, so here's a more simple explanation: http://www.clusterdb.com/mysql-cluster/get-mysql-replication-up-and-running-in-5-minutes
Those docs should work for MySQL 5.X and 8.X.