Question : Executing SQL between local MySQL and hosted MySQL

Hi I'm new to MySQL  (usually working with MS SQL Server).

I transfer data between SQL Servers from SQL Server Management Studio with SQL statements.

Question: Is there an equivalent in MySQL where I can fire off SQL statements that transfer (eg. rows) from my local MySQL to the hosted MySQL?

I have MySQL Administrator, MySQL Migration Toolkit and MySQL Query Browser, and of course phpmyadmin.

Thanks!

Answer : Executing SQL between local MySQL and hosted MySQL

aahh!! well first of all you need to check if you can access your remote server from your machine...

For eg. from your query browser try connecting remote server with username password and ip address [or hostname].

No once you confirm that you have accessibility to your remote server you have a few methods for copying data:
1. If you're interested to stick with the syntax you want to use as INSERT INTO ... SELECT * FROM..
you'll have to use federated table. Create it as explained here: http://dev.mysql.com/doc/refman/5.0/en/federated-use.html

And then you can use your above statement.


2. Load MySQLDump:
On Dos Prompt::
--------------------
Table SQL Dump:
mysqldump -uUSER -pPASSWORD DATABASENAME TABLENAME > TABLENAME.sql
Load SQL Dump:
mysql -uUSER -pPASSWORD -hREMOTE-HOST-IP DATABASENAME < TABLENAME.sql

Or you can take dump from phpmyadmin / mysqladministrator as well and load if you're comfortable with GUI.

you can finish your task using any of the above two methods


Random Solutions  
 
programming4us programming4us