longtext 报错原因

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

max_allowed_packet = 20M
lower_case_table_names = 1

my.ini  

apache:
如果采用RPM包安装,安装路径应在 /etc/httpd目录下
apache配置文件:/etc/httpd/conf/httpd.conf
Apache模块路径:/usr/sbin/apachectl
web目录:/var/www/html
如果采用源代码安装,一般默认安装在/usr/local/apache2目录下

php:
如果采用RPM包安装,安装路径应在 /etc/目录下
php的配置文件:/etc/php.ini
如果采用源代码安装,一般默认安装在/usr/local/lib目录下
php配置文件: /usr/local/lib/php.ini
或/usr/local/php/etc/php.ini

mysql:
如果采用RPM包安装,安装路径应在/usr/share/mysql目录下
mysqldump文件位置:/usr/bin/mysqldump
mysqli配置文件:
/etc/my.cnf或/usr/share/mysql/my.cnf
mysql数据目录在/var/lib/mysql目录下
如果采用源代码安装,一般默认安装在/usr/local/mysql目录下
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
max_allowed_packet = 20M
lower_case_table_names = 1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid



mysql 重启:
  service mysqld restart
  
 systemctl stop firewalld.service
- 
- 1. 
- 1. 1. 1) 方法1
- 1. 1. 可以编辑my.cnf来修改(windows下my.ini),在[mysqld]段或者mysql的server配置段进行修改。
- 1. 1. max_allowed_packet = 20M
- 1. 1. 如果找不到my.cnf可以通过
- 1. 1. mysql --help | grep my.cnf
- 1. 1. 去寻找my.cnf文件。
- 1. 1. 2) 方法2
- 1. 1. (很妥协,很纠结的办法)
- 1. 1. 进入mysql server
- 1. 1. 在mysql 命令行中运行
- 1. 1. set global max_allowed_packet = 2*1024*1024*10
- 1. 1. 然后关闭掉这此mysql server链接,再进入。
- 1. 1. show VARIABLES like '%max_allowed_packet%';
      1. 查看下max_allowed_packet是否编辑成功

转载于:https://my.oschina.net/u/1052192/blog/759087

你可能感兴趣的:(数据库,java,php)