本文共 2602 字,大约阅读时间需要 8 分钟。
- ERROR 1146 (42S02): Table 'test.user' doesn't exist
- ERROR 1215 (HY000): Cannot add foreign key constraint
- 被关联字段必须是至少是有unique约束的,没有则报错
- ERROR 1062 (23000): Duplicate entry '1' for key 'id'
- ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
- auto_increment字段必须定义一个键(key),primary或unique
- ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (
test
.test_1_1
, CONSTRAINT fk_test_1
FOREIGN KEY (id
) REFERENCES test_1
(id
) ON DELETE SET NULL ON UPDATE CASCADE) - ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign key(teacher_id) references teacher(tid) on delete cascade on update cascade' at line 1
- ERROR 1022 (23000): Can't write; duplicate key in table '#sql-13ce_5'
- 使用alter添加约束的名称和已经存在的约束名称相同
- ERROR 1364 (HY000): Field 'age' doesn't have a default value
- ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'day40.employee.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
- ERROR 1093 (HY000): You can't specify target table 'book' for update in FROM clause
- ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'day40.staff.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
- ERROR 1242 (21000): Subquery returns more than 1 row
- ERROR 1052 (23000): Column 'sid' in field list is ambiguous
- sid字段位置模糊,一般需要给table命别名,或者使用具题table’s name指定即可
- ERROR 1248 (42000): Every derived table must have its own alias
- ERROR 1630 (42000): FUNCTION t2.max does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
- pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 61] Connection refused)")
- 通过socket连接mysql出错,通常是默认参数和传参出现问题
- 默认端口号3306,可以通过sudo lsof -i:3306查看
- host中可以使用localhost或127.0.0.1测试
- AttributeError: 'module' object has no attribute 'connect'
- 模块是否正确安装,如果已经安装
- 检查py文件名和模块名重复
- pymysql.err.OperationalError: (1044, "Access denied for user 'guest'@'%' to database 'test'")
- pymysql.err.OperationalError: (1045, "Access denied for user 'guest'@'192.168.0.103' (using password: YES)")
转载于:https://www.cnblogs.com/henryw/p/10965946.html