摘要: 1,准备工作: 安装MySQL2 驱动(库名称为mysql2 ): npm install mysql2 2,编写js代码: // 显式建立连接 const mysql = require('mysql2'); //创建到数据库的连接 const connection = mysql.createC 阅读全文
posted @ 2021-05-23 23:07 阿向向 阅读(295) 评论(0) 推荐(0) 编辑
摘要: // TCP 服务器; const net = require('net'); let clientNo = 0; const server = net.createServer((client)=>{ clientNo++; console.log(clientNo + '号客服端已连接'); c 阅读全文
posted @ 2021-05-23 21:09 阿向向 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-05-23 00:20 阿向向 阅读(23) 评论(0) 推荐(0) 编辑