I'm working on a CRM running on a MS Server working with a MSSQL Database and now I have designed a new platform for the CRM on a linux server with a MySQL database.
I've already used MySQL Workbench to migrate my MSSQL database to MySQL. However I would like to automatically sync them once per day.
Is there any tool or script (preferably on PHP) available for this kind of job. Otherwise can you give me an idea on how to do this?
Thanks in advance.
The process you want is called replication. Both SQL Server and MySQL support it. Here are links to the info you need to read:
MySQL Replication
SQL Server Replication
Related
I am trying to setup remote access to the data of Sage 100 Advanced ERP for use within a website running on a MySQL database. I only need to get inventory levels for products, so it's a read-only application.
As I understand it, Sage 100 comes with an ODBC driver that can allow remote access to Sage's flat-file data storage by creating a database view. What I need to do is copy a few fields from that data on the Sage server over to the web server hosting the website.
To automate this process, I assume I'll need to setup a cron job on the web server that runs a PHP script (preferred language) executing SQL queries that connect to the remote server, extract the needed data, and write it to the appropriate tables in the MySQL database. I'm fine with that last step, but I'm unsure of the steps to connect and retrieve data from the ODBC data source.
How can I connect to and extract Sage 100 data from an ODBC Data Source to write to a MySQL Database on another server?
Or, is there a way to sync/mirror the ODBC Data Source to a MySQL Database on a separate server that I could then use to copy data over to the website's database?
Note: MySQL has documentation on pulling data FROM MySQL using ODBC, but no info on how to import data TO MySQL using ODBC on an external server.
It's actually very easy. Just establish an ODBC connection to the SOTAMAS90 DSN. Your connection string looks like this:
"DSN=SOTAMAS90; UID=MyUserId; PWD=MyPassword; Company=ABC"
Note that by default Sage installs a 32-bit version of the driver, which means you must target your application to 32 bits. Or you can install the 64-bit version of the driver, which can be found in your Sage directory, in the WKSetup folder.
After that just write code to SELECT * from each of the tables you need, and write them into your MySql database.
I don't really know MySql well, but in SQL Server you can set up a Linked Server, point it to SOTAMAS90, and then query the SQL Server database instead of the ODBC driver. But it's slow. Much better performance if you can run a nightly ETL to populate your MySQL database and query that. Be sure to set foreign keys and create indexes for them after to define the tables.
Hope that helps.
Aaron
I'm working on redesigning a database for a client. The client's original database was set up using ASP.net. However, my redesign involves creating a MySQL database (MySQL'll meld much better with the redesigned website).
Is there a way to export the data from the ASP.net set up so that I can include it in the MySQL database?
If the migration is from Microsoft SQL Server to MySQL, this might help
Migrating from ms sql server to mysql using workbench migration wizard
How do I connect SQL server 2012 with php 5.6.3?
Like in mysql I use phpMyAdmin, how is it done in SQL server 2012?
Where do I have to save the database?
Nothing changes much while using different database service.
You can use Microsoft SQL Server Management Studio 2012 to create and manage your database.
Databases are automatically saved to SSMS's ( SQL Server Management Studio ) default location. But they can be easily transferred to different location by copying .mdf and .ldf files.
While using php ( or any other language ), make sure to keep running SQL Server Service and use proper connection String to connect to database.
Connecting to database
If you are on windows, use sqlsrv extension and do not forget install SQL Server Native Client 2012. sqlsrv supports also PDO - just use right connection string. On unix try to use mssql or odbc extension.
phpMyAdmin alternatives
SSMS (SQL Server Management Studio 2012) - tool that you can use but it is more for database administrators than developers.
SSDT (SQL Server Development Tool) - similar to SSMS but it is also capable to creating snapshots, comparing schemas, data-tier apps and much more. It is a part of Visual Studio or as standalone app.
Administration
SQL Server is a little bit more sofisticated database than MySQL. Database files are stored in Program Files by default (.mdf for database files, .ldf for transactions log). All administrator tasks, that you want to make as developer, could be done from SSMS (not from configuration file).
i have 2 servers one is using MS SQL database and it is under Windows OS and the other is using MySQL and it is under Ubuntu Server 14.04. Because the Windows server is active and it is using a software that i dont/cant change it or use other software i am stuck for now with using the MS SQL server for entering the data into the data base, but i need to use the data and expand the this data (data base) using a custom build website (php with mysql). So is there a way i can make a custom php function and extract the MS SQL data base on daily base and import it into the MySQL server? If this can be done i will be very greatful if someone can point me the way.
Alternativly: if someone can show/help me using the MS SQL code to connect and retrieve data from MS SQL server it will be great as well, but i prefer using the MySQL server if it can be done somehow.
Thank you!
I manage to do this by using 2 connections at the same time. One for the ms sql database and the other for mysql data base. I am using SQL Server 2005 for the ms sql data base and phpmyadmin for the mysql data base. i manage to do the connections using the functions:
for mssql:
mssql_connect, mssql_select_db, mssql_fetch_array and mssql_query
and for mysql:
mysqli
hope that helps someone in need! if u have questions let me know!
I have a website running with php and mysql on Centos(Amazon instance). The newly brought ERP(to be integrated with existing system) uses Oracle as db(located on a separate Windows server). The orders from the website are inserted into the Master Mysql database and which are replicated into the Slave Mysql database. These orders need to be pushed to the Oracle Db. I have arrived on 4 methods to do this.
Use mysql UDF for http communication that would send the rows on a Insert Trigger on the slave to the Oracle webservices on Oracle server
Use cron jobs(with a low interval may be 5 mins,polling) with Php script that would get the new orders from mysql and send to the Oracle db via Oracle services/Php services on Oracle hosted server.
Use sys_exec() udf to invoke php script to insert into Oracle db
Use memcached with MySql and let Php poll the memcached to retrieve data and send it to Oracle server, but unsure whether we could migrate existing Mysql version to new version Mysql 5.6
I already have the UDF's in place and tested them, they are good to go. but still in dilemma regarding data integrity and reliability in case of using UDF's with triggers.
Is there a better method for doing this. Or else which method shall I follow to do the same.
I am aware of the security threats of UDF's, you can't restrict it to any user
One more thing I am not allowed to introduce new changes to the existing website php code for the operation.
SymmetricDS replicates parts of or entire database schemas across different vendor products. It works by installing triggers, but it replicates on a transaction basis ensuring that transactions gets replayed onn target database (s) in the right order.