解决方法:
$ {- j" X4 ^" R- d+ g5 [* b! n
' }/ B. O8 t& e5 K) G! d% M2 W0 ]修改MySQL数据库配置文件etc/my.cnf
' p/ h# |! B! o: H! ~- L
- j) R, W. K, w; A在[mysqld]最下面添加
$ v. X+ Z w# f" F( E2 M" N1 I- ~' v7 w: H
skip-name-resolve
- _0 U1 N- R1 E6 ?% }
) m' }" a- x/ e3 X# For advice on how to change settings please see
0 }' ]1 X4 M. o' y, g2 S E9 k#
http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
( \1 v7 D; U+ j9 Q" r& g" L[mysqld]
0 N2 R Y. E" d
#
8 A2 A- n$ P2 e" {# Remove leading # and set to the amount of RAM for the most important data
/ i. y; O, C& ^5 ^" G
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
* ^9 @) L" C$ V7 s" s/ [2 B5 ^# innodb_buffer_pool_size = 128M
5 ]: e+ k+ i5 x: o$ M% q#
! S: u$ g$ y, |6 G# Remove leading # to turn on a very important data integrity option:
Y, z: d$ ^3 g4 H+ `' c' g! plogging
/ _( n& U h8 G5 r# r
# changes to the binary log between backups.
) ^6 Z1 }) y1 @) R
# log_bin
4 {5 |6 U# T& C4 h D7 Q5 g! \3 x) [#
+ q" h# O; {( @/ t# Remove leading # to set options mainly useful for reporting servers.
0 N+ z0 a3 }* U# The server defaults are faster for transactions and fast SELECTs.
) l. j2 P" h: P; ?# [4 U6 J0 R
# Adjust sizes as needed, experiment to find the optimal values.
. ?& E6 R+ }- Q, ^! w' c( \& d# join_buffer_size = 128M
y4 r+ I4 Q3 w: ~7 I& u
# sort_buffer_size = 2M
& J) ]6 U* M( A+ z& @- j
# read_rnd_buffer_size = 2M
$ z9 V. y# u' i A- h
datadir=/var/lib/mysql s
7 ?/ v) }5 Q3 z% C9 Hocket=/var/lib/mysql/mysql.sock
+ H/ ~. A% I3 D3 W' A# Disabling symbolic-links is recommended to prevent
% b# s4 V) P' i) m% s
assorted security risks
6 M* k. i$ {4 i8 N' ]4 y) Jsymbolic-links=0
0 C( v$ b5 u o9 V
# Recommended in standard MySQL setup
* P0 \ O. ^ `5 Q/ M. y
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
1 i- P5 x4 ~/ a; a! q6 N. ~. G. imax_allowed_packet = 32M
4 e; E( ^! d, h! p; ]0 V4 ^/ J# Zmax_connections = 1000
( w+ h. X6 o5 D$ O7 P: @
max_connect_errors = 2000
5 `9 O+ R* d k0 c3 u askip-name-resolve
. r4 i( w8 @8 S" R) W6 q" R4 N
[mysqld_safe]
. O9 x; a9 I; ]! b
log-error=/var/log/mysqld.log
3 o' ~, N; z7 Q. `! j1 lpid-file=/var/run/mysqld/mysqld.pid
! R, W6 J: P2 k- b3 k
然后重启MySQL服务
6 O7 a0 v3 t Z' V: V; I8 H* n- r0 Q7 E* A* |2 B& s8 z
service mysqld restart
" L; e4 Z. P$ ^* [9 `! R" _
" ^3 H" p# l k( b6 V7 s0 T# \