mysql数据库编码问题:
1、 查看数据库编码:
show variables like "%character%";
show variables like "%collation%";
1)、 修改数据库的编码 : ALTER DATABASE `pinban` DEFAULT CHARACTER SET utf8 ;
2)、 修改服务编码 :
sql语句(只能是临时的修改,重启后就会成原样)
set collation_database=utf8_general_ci;
set collation_connection=utf8_general_ci;
set collation_server=utf8_general_ci;
配置文件的修改:
character-set-server=utf8
collation-server=utf8_general_ci
==========================================================
mysql数据库concat()问题:
报错:Result of concat() was larger than max_allowed_packet (1024) - truncated
1、查看数据库允许最长字符的concat()
show variables like "%max_allowed_packet%";
修改:
sql语句(只能是临时的修改,重启后就会成原样)
set global max_allowed_packet = 25600;
配置文件的修改:
max_allowed_packet = 25600