mysql 问题及解决

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_40337012/article/details/80201119

1、 The MySQL server is running with the --secure-file-priv option so itcannot execute this statement

加上local

##load data local infile'/home/linux/Desktop/department.txt' into table department fields terminatedby'\t' lines terminated by'\n';

2、 中文乱码

###CREATE DATABASE school_roll DEFAULT CHARACTER SET utf8COLLATE utf8_general_ci;

3、 Cannot add or update a child row: a foreign key constraint fails

###删除外键约束

4、 undefined function mysql_connect()

##升级php,用mysqli_connect()

5、 ERROR 1406 (22001): Data too long for column 'sname' at row 1

###set names utf8

6、 第一行查询总为空

##因为数据文件以有BOM的UTF-8保存的,改为无BOM的UTF-8格式保存即可

##find . -type f -execsed -i 's/\xEF\xBB\xBF//' {} \;


猜你喜欢

转载自blog.csdn.net/qq_40337012/article/details/80201119