鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

数据准备

  1. 在物理机上部署MySQL,启动后登录到数据库中。
  2. 假设本文MySQL所在服务器IP地址为192.168.200.56,端口为3306,我们需要创建三个数据库dbtest1、dbtest2、dbtest3,创建两张表tb1、tb2。
    1. 创建dbtest1。
      1
      2
      3
      drop database if exists dbtest1;
      create database dbtest1;
      use dbtest1;
      
    2. 在dbtest1上创建tb1。
      1
      2
      3
      create table tb1(
      id int not null,
      gmt datetime);
      
    3. 创建dbtest2。
      1
      2
      3
      drop database if exists dbtest2;
      create database dbtest2;
      use dbtest2;
      
    4. 在dbtest2上创建tb2。
      1
      2
      3
      create table tb2(
      id int not null,
      val varchar(256));
      
    5. 创建dbtest3。
      1
      2
      3
      drop database if exists dbtest3;
      create database dbtest3;
      use dbtest3;
      
    6. 在dbtest3上创建tb2。
      1
      2
      3
      create table tb2(
      id int not null,
      val varchar(256));
      
  3. 退出数据库。
    1
    \q