解决方法:
O* e2 g: A) O# w6 Y
+ j) y5 b) g D [* \0 I$ X- B修改MySQL数据库配置文件etc/my.cnf
6 P4 ~! o- \0 a* `
; N# P& W1 `/ B2 X2 \在[mysqld]最下面添加
g% P+ C( z0 V6 F. D1 t
6 W. V3 D' u) ^, V0 d& s) ]
skip-name-resolve
4 u: p K! T8 {: h( }% o# T8 F
" [1 c3 U3 a/ u/ X# For advice on how to change settings please see
/ ]# M& F y% p9 f" i#
http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html ' f( o8 N$ J5 s, p/ N
[mysqld]
! f$ w0 W& e! x+ N, a( B4 m
#
% W. ^. S: o( f. f4 A
# Remove leading # and set to the amount of RAM for the most important data
+ `, j, E# H& ^, ~8 K7 N f6 o& u
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
4 d# Z2 \$ `' y- t) S5 J# innodb_buffer_pool_size = 128M
8 _& R9 Y. T0 b4 Q7 z% e
#
) O7 g+ a- G; { R( Q+ o# Remove leading # to turn on a very important data integrity option:
2 j6 F$ \4 |/ }: O- m" t) D0 y7 H# Plogging
- X M. G7 C8 u0 ?: |$ `, f" I$ Y0 J
# changes to the binary log between backups.
4 C5 ^: B4 l' s
# log_bin
8 N U% x) |# [% b5 ]#
: N/ p' y+ @$ e O+ M; U# Remove leading # to set options mainly useful for reporting servers.
( k0 j5 `+ d- D- _. k
# The server defaults are faster for transactions and fast SELECTs.
& \2 [* w! F+ U- [: Q9 z3 [2 O
# Adjust sizes as needed, experiment to find the optimal values.
# A. e* k+ G; `) e
# join_buffer_size = 128M
: x; n n, _* n9 s
# sort_buffer_size = 2M
( Q- Z! f2 @( m; v/ v+ I1 O# read_rnd_buffer_size = 2M
, M& B# ? P0 m4 F
datadir=/var/lib/mysql s
, ]3 o& B0 j, j) g/ I4 E. j2 S
ocket=/var/lib/mysql/mysql.sock
: |. H- N0 u: C/ e" e
# Disabling symbolic-links is recommended to prevent
8 L1 t$ ~0 s+ @assorted security risks
6 v" D0 f: k1 A! A! e0 h4 z
symbolic-links=0
1 k! l1 w8 g- v* w) P8 Z6 _
# Recommended in standard MySQL setup
2 d$ {8 V, k# }/ l5 n" E
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
" Z* T# D+ R# c& G4 ]. K1 W, smax_allowed_packet = 32M
0 i6 U# ~7 `* ]0 q2 B6 ^
max_connections = 1000
1 d9 Q5 ] T" c( V0 H& J6 g
max_connect_errors = 2000
- @& j w, U' \* `5 V
skip-name-resolve
% F! V& W6 e6 q7 {: o[mysqld_safe]
4 ^. b& W1 g0 j6 u4 ?) alog-error=/var/log/mysqld.log
3 w7 T b7 q* Y* s* spid-file=/var/run/mysqld/mysqld.pid
- p+ Q. j2 r; l- L; |然后重启MySQL服务
8 i; v2 W) M& |6 f2 a$ i [& Y7 z
1 p. G9 M5 B) q3 ?$ Aservice mysqld restart
- j, D V% A) V7 W; G
n9 u' | n" I, b