Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi everyone, My LAN is consisted o 1

Status
Not open for further replies.

lupidol

Programmer
Apr 23, 2008
125
IL
Hi everyone,
My LAN is consisted of 2 separate MySQL platforms.
In on of those 2 stations I have a database: "MyDB" that hosts a table: "MyTABLE".
At the second station I created a database with the name: "MyDB" and I'd like to import the table "MyTABLE" into that database.
In order to do so I thought I might write the following query:
Code:
CREATE TABLE MyTABLE SELECT * FROM ip.db. MyTABLE;
I typed:
Code:
CREATE TABLE MyTABLE SELECT * FROM 10.0.0.30.MyDB.MyTABLE;
and recieved an error that says: "error 1049 unknown database 10.0.0.30".
Can anyone help my put the right code to read (and whereby import) a table fro a remote station?
Thanks
 
You have to connect to the remote database server before you can run queries against it.

Code:
mysql -h remotehost -u username -p

-p with no parameters will prompt for the password.

once connected

Code:
use databasename;

Then run your query.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top