![](https://img-blog.csdnimg.cn/20190927151043371.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
数据库
数据库
ztq小天
sdasas
展开
-
mysql,redis之间数据同步
参考:https://blog.csdn.net/larry_zeng1/article/details/78850910 linux下的.sql带有\rhttps://blog.csdn.net/ali_lili/article/details/93893604 windows下的sql需要把\r去掉mysql表的测试数据sql语句SELECT CONCAT( "*4\n", '$',LENGTH(redis_cmd),'\n', redis_cmd,'\n', '...原创 2020-09-25 10:57:04 · 193 阅读 · 0 评论 -
Linux Python操作 MySQL 数据库(查询操作)
#!/usr/bin/python# -*- coding: UTF-8 -*-import MySQLdbimport getpasspassword = getpass.getpass() #不回显# 打开数据库连接db = MySQLdb.connect("localhost", "root", password, "ztq", charset='utf8' )# 使用c...原创 2019-10-08 09:32:46 · 205 阅读 · 0 评论 -
Linux Python操作 MySQL 数据库(删除表操作)
#!/usr/bin/python# -*- coding: UTF-8 -*-import MySQLdbimport getpasspassword = getpass.getpass() #不回显# 打开数据库连接db = MySQLdb.connect("localhost", "root", password, "ztq", charset='utf8' )# 使用c...原创 2019-10-08 09:32:35 · 160 阅读 · 0 评论 -
Linux Python操作 MySQL 数据库(插入数据操作)
#!/usr/bin/python# -*- coding: UTF-8 -*-import MySQLdbimport getpasspassword = getpass.getpass() #不回显# 打开数据库连接db = MySQLdb.connect("localhost", "root", password, "ztq", charset='utf8' )# 使用c...原创 2019-10-08 09:32:40 · 282 阅读 · 0 评论 -
Linux Python操作 MySQL 数据库(显示数据库的表)
#!/usr/bin/python# -*- coding: UTF-8 -*-import MySQLdbimport getpasspassword = getpass.getpass()#password = raw_input("输入mysql密码:")# 打开数据库连接db = MySQLdb.connect("localhost", "root", password,...原创 2019-10-08 09:32:30 · 206 阅读 · 0 评论 -
Linux Python操作 MySQL 数据库(建表)
1.创建表操作#!/usr/bin/python# -*- coding: UTF-8 -*-import MySQLdbimport getpasspassword = getpass.getpass() #不回显# 打开数据库连接db = MySQLdb.connect("localhost", "root", password, "ztq", charset='utf8' ...原创 2019-10-08 09:32:23 · 256 阅读 · 0 评论 -
Linux Python操作 MySQL 数据库
MySQLdb 是用于Python链接Mysql数据库的接口,它实现了 Python 数据库 API 规范 V2.0,基于 MySQL C API 上建立的。如何安装MySQLdb?1.为了用DB-API编写MySQL脚本,必须确保已经安装了MySQL。新建文件test_mysqldb.py复制以下代码,并执行:#!/usr/bin/python# -*- coding: UTF-8...原创 2019-10-08 09:32:17 · 305 阅读 · 0 评论 -
linux mysql 导入导出数据
导出数据mysql> select * from stu_info1 -> into outfile '/root/123.txt';ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement...原创 2020-01-09 14:31:00 · 142 阅读 · 0 评论 -
linux mysql 删除自增序列的字段后后,重新排序
mysql> select * from stu_info1;+----+----------+------------+-------------+| id | name | birth | tel |+----+----------+------------+-------------+| 1 | ztq | 1994-12-2...原创 2020-01-09 14:31:16 · 236 阅读 · 0 评论 -
Linux mysql 事务
在 MySQL 中只有使用了 Innodb 数据库引擎的数据库或表才支持事务。事务处理可以用来维护数据库的完整性,保证成批的 SQL 语句要么全部执行,要么全部不执行。事务用来管理 insert,update,delete 语句一般来说,事务是必须满足4个条件(ACID)::原子性(Atomicity,或称不可分割性)、一致性(Consistency)、隔离性(Isolation,又称...原创 2020-01-09 14:31:27 · 96 阅读 · 0 评论 -
linux mysql
--stu_info表+----+------+------------+-------------+| id | name | birth | tel |+----+------+------------+-------------+| 1 | ztq | 1994-12-29 | 159****0773 || 2 | tqz | 1994-11-2...原创 2020-01-09 14:31:12 · 102 阅读 · 1 评论