Can MySql 5.0 have a view of a table located on an

2020-07-22 09:54发布

Can MySql 5.0 views use tables that are located on another server? What is the syntax for creating such a view?

标签: mysql views
2条回答
对你真心纯属浪费
2楼-- · 2020-07-22 10:01

Yes, you can create objects in one database that reference another database and even another host. The syntax to do so works something like this:

USE localhost.myDB;

SELECT * FROM host2.db.tableName; 
查看更多
▲ chillily
3楼-- · 2020-07-22 10:06

Federated Tables: http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html

This allows a table to be remotely accessed as if the remote table was a local table. It has its limitations but seems to meet my needs.

查看更多
登录 后发表回答