WHCSRL 技术网

mysql远程表

首先需要在my.cnf下开启federated引擎

federated=on

重启mysql服务后,查看是否启用

show engines

创建远程表:

  1. CREATE TABLE `person_info` (
  2. `id` int(0) NOT NULL,
  3. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  4. PRIMARY KEY (`id`) USING BTREE
  5. ) ENGINE=FEDERATED
  6. CONNECTION='mysql://root:root12@192.168.196.128:3307/platform_admin/person_info';

 

推荐阅读