1.备份mysql数据库文件
目录:/var/lib/mysql
数据文件:ibdata1
结构文件:confluence
2.注意事项
1.查看数据库文件chown权限
2.设置数据库引擎InnoDB
[mysqld]
#lower_case_table_names=1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#user=mysql
default_storage_engine = InnoDB
#Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
#set-variable = max_connections=3200
max_connections=100 #最大连接数
innodb_buffer_pool_size = 256M
#skip-name-resolve
#skip-grant-table
max_allowed_packet=128M
port =3306
skip-locking
key_buffer = 128M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
log_slow_queries=1 # 1为打开
long_query_time=1 #慢查询定义的秒数
log_queries_not_using_indexes=1 #查询未用索引记录日志
#slow_query_log_file=/app/pro/logs/mysql/mysqld-slow.log #慢查询日志文件
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
socket=/var/lib/mysql/mysql.sock
default-character-set=utf8 #设置编码,解决java程序中文无法查询问题