Linux 作业
xshell 连接linux
- 域名:shell.ceshiren.com
- 端口:22
- 用户名:ck28xxxx
- 登录密码:hogwarts
启动 Web 服务
- 执行命令: python3 -m http.sever 8181
copy jar 包并启动
- 执行 copy 命令:cp /tmp/spring-petclinic.jar /home/ck281594/spring-petclinic.jar
- 执行命令后台启动并增加日志:nohup java -jar spring-petclinic.jar --server.port=8181 > nohup.out 2>&1 &
数据库执行命令
- 插入 owners 表数据语句:
INSERT INTO owners
(`first_name`, `last_name`, `address`, `city`, `telephone`)
VALUES
('sql录入First Name', 'sql录入Last Name', 'sql录入Address', 'sql录入city', '0987654321');
- 插入 pets 表数据语句:
INSERT INTO pets
(`name`, `birth_date`, `type_id`, `owner_id`)
VALUES
((SELECT last_name FROM owners WHERE first_name = 'sql录入First Name'),
'2023-10-23', 3, (SELECT id FROM owners WHERE first_name = 'sql录入First Name'));
- 插入 vets 表数据语句:
INSERT INTO vets
(`first_name`, `last_name`)
VALUES
((SELECT first_name FROM owners WHERE first_name = 'sql录入First Name'),
(SELECT last_name FROM owners WHERE first_name = 'sql录入First Name'));
- 插入 visits 表数据语句:
INSERT INTO visits
( `pet_id`, `visit_date`, `description` )
VALUES
((SELECT id FROM pets WHERE owner_id = 14),
'2023-10-23', 'sql录入description' );
网页查询结果如下: