DB20000I The DB2START command completed successfully.
6.创建数据库
进入db2环境
~> db2
db2 =>
--创建数据库
db2 => create database mydb
几分钟后会有创建成功的提示
DB20000I The CREATE DATABASE command completed successfully.
-- 连接数据库
db2 => connect to mydb
稍后提示连接成功
Database Connection Information
Database server = DB2/LINUXX8664 9.7.0
SQL authorization ID = DB2INST1
Local database alias = MYDB
--列出数据库
db2 => LIST ACTIVE DATABASES
Active Databases
Database name = MYDB
Applications connected currently = 1
Database path = /home/db2inst1/db2inst1/NODE0000/SQL00001/
6. 创建表并插入数据
db2 => create table test_table(id integer, name varchar(20))
DB20000I The SQL command completed successfully.
db2 => list tables
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
TEST_TABLE DB2INST1 T 2024-03-06-21.07.22.600486
1 record(s) selected.
--插入数据
db2 => insert into test_table values(1, 'Zheng')