在linux下写的mysql无法插入,sql语句在复制中变'脏'的问题_MySQL
bitsCN.com
1:问题故障描述 因为在linux下开发,所以修改mysql字段的时,用的phpmyadmin来直接修改生成修改后的sql,然后复制进word(libreoffice)后提交到项目管理系统, 同事发到项目管理系统后不能运行.于是有了这篇文章. 2:首先新建表 [delphi] CREATE TABLE IF NOT EXISTS `nns_ad_log_count` ( `nns_id` char(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '广告ID', `nns_access_type` tinyint(4) NOT NULL COMMENT '0:5m 1:1h 2:24h=1d', `nns_access_day` date NOT NULL COMMENT '哪一天的', `nns_access_index` int(11) NOT NULL COMMENT '间隔数,5m 1h 1d=24h', `nns_access_count` int(11) NOT NULL ) ENGINE=InnoDb DEFAULT CHARSET=utf8; 这步是OK的.接着因为项目扩展,增加了1个字段,同时需要修改一个表的字段名和另外几个表的default 默认值和类型 [sql] ALTER TABLE `nns_ad_log_count` CHANGE `nns_id` `nns_ad_id` CHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '广告ID'; 上面这步,是用的phpmyadmin添加的字段后生成的一句sql, 看上去是没问题的,复制到word里面,再拿到mysql里面执行一下
报错了.百思不得其解,为什么会这样子呢? 3: 错误分析.生成的sql,是干净的, 途中同事只粘贴进了word. 于是手写了一遍这个sql,并且在mysql里面运行 (为了测试,我复制了上面的表结构,并且新建了一个测试的表`nns_ad_log_count1`)
运行正常同事只复制了一次,粘贴到了word (libreoffice) 我重复一下他的动作
"1. 先用浏览器打开phpmyadmin,在phpmyadmin里面直接修改一次,产生sql语句""2. 在phpmyadmin 里面,复制生成的sql到系统的剪贴板缓存""3. 粘贴进word""4. 重复其他的修改操作,重复1,2,3步""5. 把整个word发送给我""6. 我把word里面的sql拷贝出来,运行 ""7. 报错"打开word,发现sql的语句的空格在word里面高亮了
但是在mysql里面直接执行并没能看见这个东西,在phpmyadmin里面执行上面的sql
空格显示出来了,原来是这个Â 自此问题已经明了.sql语句在复制到word后给污染了. 但是为什么会这样子污染呢? 发现只有word粘贴进去后,会把utf8下的空格换成Â 这个应该是linux下的office工具的问题, 这里就不再陈述了 4: 后记, 在linux下做开发提交的sql语句,建议复制到vim里面查看详细的格式,或者更简单的,复制出来后,在浏览器地址栏粘贴一次再复制进word来提交文档.以免sql变脏出错.
bitsCN.com

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





This AI-assisted programming tool has unearthed a large number of useful AI-assisted programming tools in this stage of rapid AI development. AI-assisted programming tools can improve development efficiency, improve code quality, and reduce bug rates. They are important assistants in the modern software development process. Today Dayao will share with you 4 AI-assisted programming tools (and all support C# language). I hope it will be helpful to everyone. https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot is an AI coding assistant that helps you write code faster and with less effort, so you can focus more on problem solving and collaboration. Git

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

On March 3, 2022, less than a month after the birth of the world's first AI programmer Devin, the NLP team of Princeton University developed an open source AI programmer SWE-agent. It leverages the GPT-4 model to automatically resolve issues in GitHub repositories. SWE-agent's performance on the SWE-bench test set is similar to Devin, taking an average of 93 seconds and solving 12.29% of the problems. By interacting with a dedicated terminal, SWE-agent can open and search file contents, use automatic syntax checking, edit specific lines, and write and execute tests. (Note: The above content is a slight adjustment of the original content, but the key information in the original text is retained and does not exceed the specified word limit.) SWE-A

Go language development mobile application tutorial As the mobile application market continues to boom, more and more developers are beginning to explore how to use Go language to develop mobile applications. As a simple and efficient programming language, Go language has also shown strong potential in mobile application development. This article will introduce in detail how to use Go language to develop mobile applications, and attach specific code examples to help readers get started quickly and start developing their own mobile applications. 1. Preparation Before starting, we need to prepare the development environment and tools. head

Android development is a busy and exciting job, and choosing a suitable Linux distribution for development is particularly important. Among the many Linux distributions, which one is most suitable for Android development? This article will explore this issue from several aspects and give specific code examples. First, let’s take a look at several currently popular Linux distributions: Ubuntu, Fedora, Debian, CentOS, etc. They all have their own advantages and characteristics.

As a fast and efficient programming language, Go language is widely popular in the field of back-end development. However, few people associate Go language with front-end development. In fact, using Go language for front-end development can not only improve efficiency, but also bring new horizons to developers. This article will explore the possibility of using the Go language for front-end development and provide specific code examples to help readers better understand this area. In traditional front-end development, JavaScript, HTML, and CSS are often used to build user interfaces

"Understanding VSCode: What is this tool used for?" 》As a programmer, whether you are a beginner or an experienced developer, you cannot do without the use of code editing tools. Among many editing tools, Visual Studio Code (VSCode for short) is very popular among developers as an open source, lightweight, and powerful code editor. So, what exactly is VSCode used for? This article will delve into the functions and uses of VSCode and provide specific code examples to help readers

PHP belongs to the backend in web development. PHP is a server-side scripting language, mainly used to process server-side logic and generate dynamic web content. Compared with front-end technology, PHP is more used for back-end operations such as interacting with databases, processing user requests, and generating page content. Next, specific code examples will be used to illustrate the application of PHP in back-end development. First, let's look at a simple PHP code example for connecting to a database and querying data:
