configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no

试了网上的几种方法,包括:

1.sudo ln -s /usr/local/mysql/lib/libmysqlclient.so /usr/lib/

sudo ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18

2.yum groupinstall "Development tools" 

3.vi /etc/ld.so.conf.d/local.conf

/usr/local/lib

:wq

ldconfig -v

最后解决方法:

# export LD_LIBRARY_PATH=/usr/local/mysql/lib:/lib/:/usr/lib/:/usr/local/lib