longtext 報錯緣由

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是否編輯成功
相關文章
相關標籤/搜索