I have my web based Qoute/Invoice system running at our local server (based on codeigniter). And our website hosted externally (one.com, based on Laravel). lets say i want table products and product families from database local be synced to the remote database in the representitive tables offcourse. Both mysql databases. Also the local database is the "master" so most changes will be made in the local database but i would like the remote database to sync so we can display our producs on the website. the only thing we could change in the remote database is if we display the product or not.
So the question is how i could get those two databases to sync. How could I do a script to do this?
From what i understand is you want two database from different servers to be synchronized. You can do that by setting up master-master replication.
Here's a good step by step documentation for you.
SymmetricDS can replicate between MySQL databases locally or remotely over HTTP or HTTPS. There is an open source version that might be sufficient for your needs.
SymmetricDS community
There is also a professional version if you want to add support.
SymmetricDS pro
Related
I have recently joined a project that uses AWS EC2 to deploy a frontend in NodeJS and a backend in Laravel linked to a phpMyAdmin database. My question is simple but I have not found the way to do it despite litteral hours of research.
How can I launch the backend locally and use the corresponding database?
I should add that the database seems to be automatically generated by the Laravel backend and it contains a folder of "mutations".
I am relatively new to php, VMs and Linux overall.
Thank you for your help
This project is probably using mysql or mariadb as database engine.
You must install the engine and export all of data from server and import it in your local database.
If database is on server and you want to connect to that database, it depends on security mechanisms. You must expose the db engine's port in the server and changing your laravel config to use that host for database connection. But I don't recommend that!
If you just want to run backend for personal tests, just setup backend and database engine and run migrations. I can't help you with this step cause I don't know how are deploy operations in your team. If you provide more information, we can help better.
For my project, there are webapps installed on local servers. Whenever there is internet connection available, a press of a sync button on local server app should sync the database and the user uploaded files with central server. The central server should know from where the data is coming. I am building the local server apps using laravel 4.2. Is there a simple way I can achieve this?
I solved it using an extra column synced in all the tables on both local and cloud server and wrote code to send data through JSON APIs. Then, I updated the synced column with timestamp on both ends. And then on every sync button press, I compared updated and synced column and sent the data to the server accordingly.
I don't know if this is the perfect solution but worked for me.
I developed a PHP driven Web App with a MySQL backend. New requirement is to have it available offline too at a client's office, once there is an lnternet connection, the two should sync so that both local and online versions are the same. Any advice on how best to implement this?
I found MySQL database Master-Master Replication helpful.
https://www.linode.com/docs/databases/mysql/configure-master-master-mysql-database-replication
no need to write code
Basically, I want to create an application like this:YOUTUBE
I want to create an application that when I add some information from my web host (either PHP or MYSQL) VB.NET will read it.
From your website you'll need to insert the data into your MySQL database.
The problem with using the database provided by your web host is that the chances are, due to 'Security Reasons' the will have disabled external access.
This means that any files outside of your web server (your sites root/sub directory) will not be able to access the data. So, while your website will be able to connect without a problem, your program will not.
Some hosts give its customers the opportunity to add an IP address to a white list which enables them to bypass their security system. However, most will not give you this option.
My suggestion is that you either rent a VPS where you can run both the WebServer and Your MySQL database (and PHPMyAdmin) from or Set Up A MySQL database on your PC (its not that difficult just read the manual and youll be fine). If you had a VPS then you would no longer need your pre hosted webserver as you could run your own. You would need to point your domain name to your VPS webserver. It will act just like any other.
By running your own MySQL Databse you are given the option to enable remote access. This means that any external entity with the correct details will be able to connect.
If you cant get a VPS or don't want to run your own server or rent a server that allows for external access. Check out db4free.net .They provide you with a free MySQL Database with external access for Developers to test out their systems. They are not ultra fast so that's something you may want to be aware of. Another thing is that your data that's held can be removed at any time. The servers are not there to be used permanently just for testing.
So how do I connect to it through VB???
Good Question! To establish a connection, I suggest you use MySQL.Data library provided my DevMySQL themselves and import it into your program. Done so by Imports MySQL.Data.MySQLClient. This is written by them to work with their databases. Yes you can connect using some of the functions already in VB but in my opinion they don't work as efficiently. You'll need to download the MySQLConnector to connect as well.
Hopefully That Answers Your Questions. Any Problems Just Comment below!
Regards
Joe
Good day. I have a thesis project. it is composed of a webpage created on php and a system using vb.net 2008.
As of now , they are both connected to the same database.
I am wondering if it is possible that if i packaged the system and live the website, will still be connected with one database? Thank you in advance.
If I understand you right (and the question could be better worded), you're asking what happens if you deploy the website on a different server than the one you used to develop it. The short answer is that, unless the machine hosting the database is accessible to the web server host machine, that you would also have to redeploy the database.
In other words, wherever you move the PHP-based website and VB.NET system, they would need to be able to access the machine hosting the database server. Otherwise, I see no issue with them both accessing the same database.