随笔分类 - mysql数据库
摘要:import threading import pymysql from dbutils.pooled_db import PooledDB MYSQL_DB_POOL = PooledDB( creator=pymysql, # 使用链接数据库的模块 maxconnections=5, # 连接池
阅读全文
摘要:事务的四大特性: 原子性(Atomicity): 一个事务(transaction)中的所有操作,要么全部完成,要么全部不完成,不会结束在中间某个环节。事务在执行过程中发生错误,会被回滚(Rollback)到事务开始前的状态,就像这个事务从来没有执行过一样。 一致性(Consistency): 在事
阅读全文
摘要:创建账号: create user 'yy'@'127.0.0.1' identified by '123'; 删除用户: drop user 'yy'@'127.0.0.1'; 修改用户: rename user 'yy'@'127.0.0.1' to 'zz'@'10.10.80.44'; 授权
阅读全文
摘要:条件查询: -- 查询name = '测试' 或 email="test.com" 和id=1 select * from db where (name = '测试' or email="test.com") and id=1; -- 查找id在(1,2,3) select * from db wh
阅读全文
摘要:创建数据库: CREATE DATABASE 数据库名; 删除数据库: drop database 数据库名; 创建数据表: CREATE TABLE table_name (列名 列的类型); ## 例子: create table test( id int not null primary ke
阅读全文
摘要:环境:mysql(5.7.17)+boost(1_59_0) 关闭防火墙(firewalld): systemctl stop firewalld systemctl enable firewalld 关闭SeLinux: vim /etc/selinux/config SELINUX=disabl
阅读全文