`

[MySQL]Error when foreign referencing in mySQL (Error 3780)

阅读更多

参考:https://stackoverflow.com/questions/58550408/error-when-foreign-referencing-in-mysql-error-3780

 

这是由于两个表的table collation不同导致的.

 

修改表collation:

ALTER TABLE `basename`.`tablename`  COLLATE=utf8_bin;

 

发现仍然不行,这是由于

1.修改数据库的collation,对修改后新建的表才会生效,已存在表不生效

2.修改表的 collation,对修改后新建的字段才会生效,已存在字段不生效

 

3.修改字段的 collation,对修改后新写入生效,同时对已存在的也生效

 

也就是说即使修改了表的collation,对现有column是不生效的,所以需要新建column 

分享到:
评论

相关推荐

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

    mysql中触发器使用详解.docx

    触发器是与表有关的数据库对象,在对表进行insert/update/delete之前或之后,会触发并执行触发器中定义的SQL语句。触发器的这种特性可以协助应用在数据库端确保数据的完整性,记录日志,校验数据等。

    Linear Referencing and Dynamic Segmentation in ArcGIS

    Linear Referencing and Dynamic Segmentation in ArcGIS, 动态分段方面的资料,外文的.

    线性参考(Linear Referencing)

    另外一个简单介绍线性参考基本知识的PPT 理论与例子相结合~~ 对大家学习很有帮助~~

    Harvard Referencing Guide

    This is a guide to the Harvard author-date referencing system. It is based on the following manual: Commonwealth of Australia 2002, Style manual for authors, editors and printers, 6th edn, rev. by ...

    线性参考(Linear Referencing and ArcGIS)

    一个介绍线性参考基本知识的PPT 理论与例子相结合~~ 对大家学习很有帮助~~

    OCP考试WORD文档(一小部分)

    Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the CUSTOMERS and TIMES tables, respectively. Evaluate the following CREATE TABLE command: CREATE TABLE...

    Harvard Referencing

    Harvard Referencing这个版本相当的权威,有助于大家参考如何写reference

    model_referencing.zip_targetlink

    this is targetlink exercise files for model_referencing

    文献查询及索引information searching and referencing.ppt

    文献查询及索引information searching and referencing

    Referencing using the Harvard author-date

    Referencing using the Harvard author-date 是科技工作者发表论文必须要掌握的要点,大名鼎鼎不多说了。

    mu Referencing Framework-开源

    muRF 是一种突出显示文档的方法,以提供有关源质量的信息,与斜体强调的方式非常相似。 想想维基百科。 开发是 Firefox 插件和相关的服务器应用程序。

    k7 SRIO参考例程

    - CR#477115 / AR#31308 - Core PNAs packet in receipt when link goes down. - Core LCSBA implementation removes 64MB of possible addressing space. - Version fixed : v4.4 - CR#472992 / AR#30939 - ...

    Sql for mysql

    CHAPTER 1 Introduction to MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Database, ...

    sis-referencing-0.6.jar

    java运行依赖jar包

    串口通讯控件

    CommBase.dll when referencing the library in the development environment. CommBaseSourceCommBase.cs CommBaseSourceCommPingPong.cs CommbaseSourceAssemblyInfo.cs Source code for CommBase.dll ...

    plsqldev12.0.7.1837x32主程序+ v12中文包+keygen

    * Export Tables in Oracle format did not work when multiple tables were selected * File > Close All could cause an Access Violation * Window List function "Close all other Windows" could cause an ...

    plsqldev12.0.7.1837x64主程序+ v12中文包+keygen

    * Export Tables in Oracle format did not work when multiple tables were selected * File > Close All could cause an Access Violation * Window List function "Close all other Windows" could cause an ...

    TMS Aurelius 210

    v2.1.0.0 New : RAD Studio XE4 support New : Full iOS support, including native access to SQLite ... Fixed : Access violation when loading package multiple times in TAureliusDataset design-time editor

    C# Game Programming Cookbook for Unity 3D - 2014

    1.1.3 Using the Singleton Pattern in Unity...........................5 1.1.4 Inheritance.................................................6 1.1.5 Where to Now?.............................................

Global site tag (gtag.js) - Google Analytics