配置mysql 的
/etc/my.cnf[mysql] no-auto-rehash default-character-set = utf8mb4 [mysqld] #skip-grant-tables log_timestamps=SYSTEM user = mysql port = 3306 basedir = /usr/local/mysql log_error = /home/mysql/mysql.log datadir = /home/mysql/data/ socket = /home/mysql/mysql.sock pid-file = /home/mysql/db.pid character-set-server = utf8mb4 collation-server = utf8mb4_general_ci skip_name_resolve = 1 open_files_limit = 65535 back_log = 1024 default_authentication_plugin = mysql_native_password # sql_safe_updates=on innodb_buffer_pool_size=8G # 说明:该参数可以提升扩展性和刷脏页性能。 # 默认值1,建议值:4-8;并且必须小于innodb_buffer_pool_instances innodb_page_cleaners=4 innodb_buffer_pool_instances=8 innodb_log_file_size=4G innodb_log_files_in_group=4 wait_timeout=3600 interactive_timeout=3600 max_connections=3000 default-time_zone='+8:00' binlog_expire_logs_seconds=604800 [client] port=3306 socket=/home/mysql/mysql.sockmkdir /var/lib/mysql/
- 将mysql.sock文件映射到/var/lib/mysql路径中
- $sudo ln -s /home/mysql/mysql.sock /var/lib/mysql/mysql.sock