【毕设进行时-工业大数据,数据挖掘】Mysql修改列名的坑

正文之前

好说歹说也算是把我手头的毕业活动搞完了,虽然成绩比较扑街,但是玩的开心就好。终于可以“愉

”的开始爆肝论文啦!好开心!

正文

上午帮一个同学搞他的上位机,娘的 !! python的GUI为什么运行到后面会越来越卡??我个人觉得是因为通信的缘故。不过也有可能是GUI用的tkinter的原因?我都不熟悉,所以有点懵逼,不过这不是重点!!


Mysql这个东西啊,我今天才发现我的数据有很严重的取错了名字的嫌疑。

当时搜集的数据集是这样的!

Faulty and healthy gear box Data sets need to be analyzed in detail. Here, we created this dataset for those who do research in wind turbine gearbox fault diagnosis. 
Data Type: Multivariate 
Task: Classification 
Attribute Type: Integer 
Number of Instances (records in your data set): 2021119 
Number of Attributes (fields within each record): 4 
Relevant Information: Data set includes Healthy and Broken Tooth data set. Data set has been recorded under variation of load from '0' to '90' percent with 4 different sensors in four directions. 
Ten different text files are available for each case (Healthy as well as Broken Tooth). 
Total Instances in Healthy case: 10,15,808 (of 10 txt files) 
Total Instances in Broken Tooth case: 10,05,311 (of 10 txt files). 
Meaning of the txt File naming: Example 'b30hz0.txt'= b stands for broken tooth, 30hz stands for recording frequency, 0 stands for loading condition 
Attribute Information: Type of Gear box 
Condition: 1) Healthy condition and 2) Broken Tooth condition
data Attribute#1: Sensor#1 
data Attribute#2: Sensor#2 
data Attribute#3: Sensor#3 
data Attribute#4: Sensor#4 

齿轮箱故障和健康需要详细分析数据集。
在这里,我们为那些研究风力涡轮机齿轮箱故障诊断的人创建了这个数据集。数据类型:多变量
任务:分类属性
类型:整数
实例数(数据集中的记录):2021119
属性数(每个记录中的字段):4
相关信息:数据集包括健康和破碎的牙齿数据集。
数据组在4个不同传感器的四个方向上从“0”到“90”百分比的负载变化下被记录下来。
每种情况下都有十种不同的文本文件(健康以及破碎的牙齿)。
健康情况下的实例总数:10,15,808(10个txt文件)
破碎情况下的实例总数:10,05311(10个txt文件)。
 txt的含义文件命名:例子'b30hz0.txt'= b代表断齿,30hz代表记录频率,0代表加载条件.
属性信息:齿轮箱类型
条件:1)健康状况和2)断齿状况
数据属性#1:传感器#1
数据属性#2:传感器#2
数据属性#3:传感器#3
数据属性#4:传感器#4

【毕设进行时-工业大数据,数据挖掘】Mysql修改列名的坑_第1张图片

我把加载条件看成频率了,所以很遗憾。。。数据表上都是直接用HZ 来代表加载比的。。

【毕设进行时-工业大数据,数据挖掘】Mysql修改列名的坑_第2张图片

然后我找了网上的一些修改列名的方式来看!!1

  • https://www.cnblogs.com/cbboys/p/4676403.html

  • https://blog.csdn.net/jjkang_/article/details/54855188

  • https://www.2cto.com/database/201205/132795.html

结果,毫无例外,都是坑!!

【毕设进行时-工业大数据,数据挖掘】Mysql修改列名的坑_第3张图片

报错都是轻一色的:

mysql>  alter table gear change  column HZ to  Load int(11);
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 'to  Load int(11)' at line 1

我一开始看错误信息还以为是语法错误,结果改了老半天也没啥效果,索性直接用错误代码查找,结果。。。就解决了!

https://blog.csdn.net/jdjdndhj/article/details/70242174

其实这个问题就是语法上的错误,在MySQL中,为了区分MySQL的关键字与普通字符,MySQL引入了一个反引号。
详情见:https://dev.mysql.com/doc/refman/5.5/en/keywords.html

在上述的sql语句中,列名称使用的是单引号而不是反引号,所以会就报了这个错误出来。修改后:

mysql> alter table gear change `HZ` `Load` int not null;
Query OK, 0 rows affected (0.06 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> 

结果当然美滋滋~ 溜了溜了!继续肝毕业论文去咯!

正文之后

哎,算上模板里面那些信息。满打满算才2400,真正自己写的不到1000字,真是桑心!继续肝

【毕设进行时-工业大数据,数据挖掘】Mysql修改列名的坑_第4张图片

对了,还得把Java代码里面的属性名字改过来,不然GG

你可能感兴趣的:(【毕设进行时-工业大数据,数据挖掘】Mysql修改列名的坑)