摘要: 1.连接 import pymysql # 创建连接 conn = pymysql.connect(host="127.0.0.1", port=3306, user="root", password="123456",db="test") # 创建游标 cursor = conn.cursor() 阅读全文
posted @ 2024-10-27 16:27 铿锵有力自信且坚定 阅读(41) 评论(0) 推荐(0)
摘要: 1. 创建一个表 create table class(id int not null primary key, name char(16)); # 插入数据 insert into class(id,name) values(1,"张三"); insert into class(id,name) 阅读全文
posted @ 2024-10-27 15:11 铿锵有力自信且坚定 阅读(51) 评论(0) 推荐(0)
摘要: 1. 创建表 create table info(id int auto_increment, name char(32) not null, age int not null, registerdate date not null, primary key (id)); 解析: auto_incr 阅读全文
posted @ 2024-10-26 16:34 铿锵有力自信且坚定 阅读(56) 评论(0) 推荐(0)
摘要: 1.登录本机数据库 mysql -uroot -p123456 2.查看有几个数据库 show databases; 2.进入某个数据库 use mysql; 3.查看数据库中有几个表 show tables; 4.查看表结构 DESCRIBE table_name; desc db; 5.查看表数 阅读全文
posted @ 2024-10-26 13:37 铿锵有力自信且坚定 阅读(93) 评论(0) 推荐(0)
摘要: SHOW VARIABLES LIKE 'character_set_database';SHOW VARIABLES LIKE 'collation_database';SHOW DATABASES;SELECT DATABASE();SHOW TABLES FROM my_data;SHOW C 阅读全文
posted @ 2024-10-26 00:15 铿锵有力自信且坚定 阅读(42) 评论(0) 推荐(0)
摘要: 1.多进程from multiprocessing import Processimport timedef f(name): time.sleep(2) print("ni hao", name)if __name__ == "__main__": for i in range(10): p = 阅读全文
posted @ 2024-10-23 22:26 铿锵有力自信且坚定 阅读(29) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2024-10-23 21:05 铿锵有力自信且坚定 阅读(1) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2024-10-23 20:59 铿锵有力自信且坚定 阅读(1) 评论(0) 推荐(0)
摘要: 1.简单例子 import threadingimport timedef run(n): print("task", n) time.sleep(2)t1 = threading.Thread(target=run, args=("t1",))t2 = threading.Thread(targe 阅读全文
posted @ 2024-10-21 22:34 铿锵有力自信且坚定 阅读(45) 评论(0) 推荐(0)
摘要: 1. 不用密码,使用密钥文件登录import paramiko#指定私钥位置private_key = paramiko.RSAKey.from_private_key_file("/root/.ssh/id_rsa")#创建ssh对象ssh = paramiko.SSHClient()# 允许连接 阅读全文
posted @ 2024-10-20 17:13 铿锵有力自信且坚定 阅读(165) 评论(0) 推荐(0)