设为首页 收藏本站
查看: 845|回复: 0

[经验分享] mysql报错

[复制链接]

尚未签到

发表于 2018-10-8 08:01:15 | 显示全部楼层 |阅读模式
1. 环境说明
  CentOS 6.5
  [root@linux-mysql02 ~]# uname -a
  Linux linux-mysql02 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
2. 问题描述
  编译安装MySQL-5.6.37和二进制安装MySQL-5.6.37,在初始化mysql后,它会自动在MYSQL_BASE目录下(/u02/mysql-5.6.37)生成一个my.cnf的文件,当然,在/etc/目录下,它也会自动生成my.cnf,但是在启动mysql之前被mv为my.cnf.bak了,所以mysql的第一生效文件就变为了/u02/mysql-5.6.37/my.cnf。
  在需要配置binlog时,打开my.cnf看到mysqld模块下只有这一句没有注释的,在网上找了下资料(https://segmentfault.com/a/1190000005936172):
  sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  稍微看了下这个模块的作用,才有了注释掉,然后重新写个my.cnf
  [root@linux-mysql02 ~]# cat /etc/my.cnf
  [client]
  port            = 3306
  socket          = /tmp/mysql.sock
  [mysql]
  no-auto-rehash
  [mysqld]
  user    = mysql
  port    = 3306
  #socket  = /tmp/mysql.sock
  #basedir = /u02/mysql
  datadir = /u02/mysql-5.6.37/data
  open_files_limit    = 1024
  back_log = 600
  max_connections = 800
  max_connect_errors = 3000
  #table_cache = 614
  external-locking = FALSE
  max_allowed_packet =8M
  sort_buffer_size = 1M
  join_buffer_size = 1M
  thread_cache_size = 100
  thread_concurrency = 2
  query_cache_size = 2M
  query_cache_limit = 1M
  query_cache_min_res_unit = 2k
  #default_table_type = InnoDB
  thread_stack = 192K
  #transaction_isolation = READ-COMMITTED
  tmp_table_size = 2M
  max_heap_table_size = 2M
  long_query_time = 1
  #log_long_format
  #log-error = /data/3306/error.log
  ##log-slow-queries = /data/3306/slow.log
  ##pid-file = /data/3306/mysql.pid
  ##log-bin = /tmp/mysql-bin
  ##relay-log = /data/3306/relay-bin
  ##relay-log-info-file = /data/3306/relay-log.info
  binlog_cache_size = 1M
  max_binlog_cache_size = 1M
  max_binlog_size = 2M
  expire_logs_days = 7
  key_buffer_size = 16M
  read_buffer_size = 1M
  read_rnd_buffer_size = 1M
  bulk_insert_buffer_size = 1M
  #myisam_sort_buffer_size = 1M
  #myisam_max_sort_file_size = 10G
  #myisam_max_extra_sort_file_size = 10G
  #myisam_repair_threads = 1
  #myisam_recover
  lower_case_table_names = 1
  skip-name-resolve
  slave-skip-errors = 1032,1062
  replicate-ignore-db=mysql
  server-id = 1
  innodb_additional_mem_pool_size = 4M
  innodb_buffer_pool_size = 32M
  innodb_data_file_path = ibdata1:128M:autoextend
  innodb_file_io_threads = 4
  innodb_thread_concurrency = 8
  innodb_flush_log_at_trx_commit = 2
  innodb_log_buffer_size = 2M
  innodb_log_file_size = 4M
  innodb_log_files_in_group = 3
  innodb_max_dirty_pages_pct = 90
  innodb_lock_wait_timeout = 120
  innodb_file_per_table = 0
  [mysqldump]
  quick
  max_allowed_packet = 2M
  [mysqld_safe]
  log-error=/tmp/mysql_oldboy3306.err
  ##pid-file=/data/3306/mysqld.pid
  保存退出,重新启动:
  [root@linux-mysql02 data]# /etc/init.d/mysqld start
  Starting MySQL. ERROR! The server quit without updating PID file (/u02/mysql-5.6.37/data/linux-mysql02.pid).
  报错!!!
  查看错误日志:
  [root@linux-mysql02 data]# vim /tmp/mysql_oldboy3306.err

  2017-08-12 18:13:18 28414 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different>  in the .cnf file: initial 8192 pages, max 0 (relevant if non-zero) pages!
  2017-08-12 18:13:18 28414 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablesp
  ace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created i
  n this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data fi
  les which contain your precious data!
  2017-08-12 18:13:18 28414 [ERROR] Plugin 'InnoDB' init function returned error.
  2017-08-12 18:13:18 28414 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  2017-08-12 18:13:18 28414 [ERROR] Unknown/unsupported storage engine: InnoDB
  2017-08-12 18:13:18 28414 [ERROR] Aborting
  1、原来的ibdata1大小为:768*16/1024=12M
  2、当前ibdata1被修改为:8192*16/1024=128M
  innodb_data_file_path = ibdata1:128M:autoextend
  发现我现在的大小就是128M,这边改为12M试试
  [root@linux-mysql02 data]# /etc/init.d/mysqld start
  Starting MySQL.. SUCCESS!
  成功启动!!!


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-615543-1-1.html 上篇帖子: Mysql 引擎的比较 下篇帖子: MySQL的基础命令<一>
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表