{"id":16249,"date":"2025-09-01T18:14:35","date_gmt":"2025-09-01T10:14:35","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=16249"},"modified":"2025-09-01T18:14:35","modified_gmt":"2025-09-01T10:14:35","slug":"mysql%e5%85%83%e6%95%b0%e6%8d%ae%e9%87%87%e9%9b%86%e5%a4%b1%e8%b4%a5%e6%8a%a5%e9%94%99incorrect-string-value-xf1xbexadxbc","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=16249","title":{"rendered":"mysql\u5143\u6570\u636e\u91c7\u96c6\u5931\u8d25\u62a5\u9519Incorrect string value: &#8216;\\xF1\\xBE\\xAD\\xBC&#8217;"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>studio3.0.1\u7248\u672c\uff0c\u5ba2\u6237\u5bf9mysql\u6570\u636e\u5e93\u5143\u6570\u636e\u91c7\u96c6\u65f6\u6267\u884c\u5931\u8d25\uff0c\u65e5\u5fd7\u663e\u793a <code> Cause: java.sql.SQLException: Incorrect string value: &#039;\\xF1\\xBE\\xAD\\xBC&#039;,...&#039; for column &#039;ddl_create&#039; at row 15<\/code><\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2025\/03\/image-1742973298414.png\" style=\"display: block;\">\n<\/div>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2025\/03\/image-1742973324235.png\" style=\"display: block;\">\n<\/div>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<p><strong>1.\u5f00\u542f\u5ba1\u8ba1\u65e5\u5fd7\u6293\u53d6sql<\/strong><\/p>\n<p>\u4ece\u91c7\u96c6\u65e5\u5fd7\u672a\u80fd\u770b\u51fa\u6267\u884c\u7684\u5177\u4f53sql\u8bed\u53e5\uff0c\u5bf9kundb\u5143\u6570\u636e\u5e93\u6bcf\u4e2akungate \u4e34\u65f6\u5f00\u542faudit\u5ba1\u8ba1\u65e5\u5fd7\uff1a<\/p>\n<p><code>set kundb_audit_filter=&quot;DCL,DDL,DML,INSERT,UPDATE,REPLACE,DELETE,SHOW,SET,TRANS,OTHER&quot;;<\/code><\/p>\n<p>\u518d\u6b21\u89e6\u53d1\u91c7\u96c6\u52a8\u4f5c\uff0c\u6293\u5230\u4e86\u6267\u884c\u62a5\u9519\u7684sql\u8bed\u53e5\u3002\u8fd9\u4e2asql\u7531\u591a\u4e2avalues\u7ec4\u6210\uff0c\u6211\u4eec\u91cd\u70b9\u5173\u6ce8<code>ddl_create<\/code>\u4e2dDDL\u7684comment\u5b57\u6bb5\uff0c\u53d1\u73b0 <code>engineering-brain.dict_industry_label<\/code> \u8868\u7684 \u8868\u7ea7comment\uff0c\u8fd8\u6709\u5b57\u6bb5 guanlian \u7684\u5217comment\u91cc\u9762\u6709\u7279\u6b8a\u5b57\u7b26\u3002<\/p>\n<div style=\"box-shadow: 1px 1px 10px rgba(0,0,0,0.1); padding: 1px; display: inline-block; width: auto; margin-bottom: 10px;\">\n  <img decoding=\"async\" src=\"\/wp-content\/uploads\/2025\/03\/image-1742973610057.png\" style=\"display: block;\">\n<\/div>\n<p><strong>2.\u7b80\u5316\u95ee\u9898sql<\/strong><\/p>\n<p>\u6211\u4eec\u521b\u5efa\u4e00\u5f20\u548c<code>database_table<\/code>\u4e00\u6837\u7ed3\u6784\u7684\u6d4b\u8bd5\u8868\uff0c\u624b\u52a8insert\u8fd9\u6761\u6570\u636e\uff0c\u6700\u7ec8\u786e\u8ba4\u662f\u5b57\u6bb5guanlian\u7684comment\u91cc\u9762\u6709\u7279\u6b8a\u5b57\u7b26\u5bfc\u81f4\u7684\uff0c\u7b80\u5316\u590d\u73b0\u8bed\u53e5\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-sql\">drop table if exists test1;\ncreate table test1 like connector_foundation1.database_table;\nINSERT INTO test1( is_deleted,name,owner,data_entity_type,authority,create_time,update_time,access_time,database_id,comment,size,ddl,ddl_create,table_location,storage_type )\nvalues \n ( 0, 'dict_industry_label', '-', 'MYSQL_TABLE', '', '2020-06-18 20:21:34', '2020-06-18 20:21:34', null, 706, '', '3 row(s)', null,\n \"CREATE TABLE engineering-brain.dict_industry_label (\n <code>id<\/code> int(11)  NOT NULL AUTO_INCREMENT,\n <code>pid<\/code> varchar(255) DEFAULT NULL,\n <code>code<\/code> varchar(255) DEFAULT NULL,\n <code>pcode<\/code> varchar(255) DEFAULT NULL,\n <code>name<\/code> varchar(255) DEFAULT NULL,\n <code>remark<\/code> varchar(255) DEFAULT NULL,\n <code>latitudes<\/code> varchar(255) DEFAULT NULL,\n <code>longitudes<\/code> varchar(255) DEFAULT NULL,\n <code>simple_name<\/code> varchar(255) DEFAULT NULL,\n <code>state<\/code> int(11) DEFAULT '0',\n <code>bs<\/code> int(11) DEFAULT '0',\n --\u8fd9\u91cc\u7684comment\u5305\u542b\u4e86\u8868\u60c5\u7b26\u53f7\n <code>guanlian<\/code> int(11) DEFAULT '0' COMMENT '\ud9ba\udf7c',\n <code>title<\/code> varchar(50) DEFAULT NULL,\n <code>e_id<\/code> int(11) DEFAULT '0',\n <code>order<\/code> int(255) DEFAULT NULL,\n PRIMARY KEY (<code>id<\/code>) USING BTREE)\n ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT=''\",\n null, 'binlog' );<\/code><\/pre>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u8fde\u63a5\u5230kundb3\u5143\u6570\u636e\u5e93\u4fee\u6539\u5b57\u6bb5ddl_create\u7684\u7f16\u7801\uff1a<\/p>\n<p><code>ALTER TABLE connector_foundation1.database_table CHANGE ddl_create ddl_create longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;<\/code><\/p>\n<p>\u8868\u9ed8\u8ba4\u4f7f\u7528\u7684\u662f utf8mb3 \u7f16\u7801\uff0c\u65b0\u7684\u5b57\u7b26\u96c6\u662f utf8mb4\uff0cMySQL \u5c06\u4f1a\u5c1d\u8bd5\u5c06\u8fd9\u4e9b\u6570\u636e\u65e0\u635f\u5730\u8f6c\u6362\u4e3a utf8mb4 \u7f16\u7801\u3002utf8mb3\uff08\u5373 utf8\uff09\u548c utf8mb4 \u90fd\u662f UTF-8 \u7f16\u7801\u7684\u53d8\u79cd\uff0c\u4f46 utf8mb4 \u652f\u6301\u66f4\u591a\u7684 Unicode \u5b57\u7b26\uff08\u5305\u62ec\u4e00\u4e9b\u8868\u60c5\u7b26\u53f7\u548c\u4e00\u4e9b\u975e\u5e38\u7f55\u89c1\u7684\u5b57\u7b26\uff09\uff0c\u800c utf8mb3 \u53ea\u652f\u6301\u6700\u591a\u4e09\u4e2a\u5b57\u8282\u7684 UTF-8 \u5b57\u7b26\u3002<br \/>\n\u56e0\u4e3a utf8mb3 \u662f utf8mb4 \u7684\u5b50\u96c6\uff0c\u6240\u4ee5\u8f6c\u6362\u901a\u5e38\u662f\u5b89\u5168\u7684\uff0c\u6570\u636e\u4e0d\u4f1a\u4e22\u5931\u6216\u6539\u53d8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 studio3.0.1\u7248\u672c\uff0c\u5ba2\u6237\u5bf9mysql\u6570\u636e\u5e93\u5143\u6570\u636e\u91c7\u96c6\u65f6\u6267\u884c\u5931\u8d25\uff0c\u65e5\u5fd7\u663e\u793a Cause: ja ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=16249\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16249","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/16249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16249"}],"version-history":[{"count":4,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/16249\/revisions"}],"predecessor-version":[{"id":17260,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/16249\/revisions\/17260"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}