gteric 发表于 2018-10-8 07:30:14

MySQL使用中遇到的问题及解决办法

  【问题一】在安装配置MySQL多实例时,出现以下问题
  ................................................................
  # cat mysql_qiuuuu3306.err

  2017-08-18 04:36:55 11343 InnoDB: auto-extending data file ./ibdata1 is of a different>  2017-08-18 04:36:55 11343 InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, 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 in 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 files which contain your precious data!
  2017-08-18 04:36:55 11343 Plugin 'InnoDB' init function returned error.
  2017-08-18 04:36:55 11343 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  2017-08-18 04:36:55 11343 /application/mysql/bin/mysqld: unknown variable 'table_cache=614'
  2017-08-18 04:36:55 11343 Aborting
  ....................................................................
  【解决办法】
  idata1与my.cnf innodb_data_file_path = ibdata1:XX:autoextend不一致造成的错误
  # cd /data/3308/data/
  # ll -h
  total 109M
  -rw-rw----. 1 mysql mysql12M Aug 18 04:43 ibdata1
  -rw-rw----. 1 mysql mysql48M Aug 18 04:43 ib_logfile0
  -rw-rw----. 1 mysql mysql48M Aug 18 03:40 ib_logfile1
  drwx------. 2 mysql mysql 4.0K Aug 18 03:40 mysql
  drwx------. 2 mysql mysql 4.0K Aug 18 04:43 performance_schema
  drwx------. 2 mysql mysql    6 Aug 18 03:40 test
  此时发现ibdata1的大小为12M,需要将/data/3308/my.cnf中的
  innodb_data_file_path = ibdata1: 12M: autoextend的大小改为12M
  【问题二】在上面的基础上面,任然报错如下
  # cat mysql_qiuuuu3306.err
  ....................................
  2017-08-18 05:18:21 23534 Plugin 'FEDERATED' is disabled.

  2017-08-18 05:18:21 23534 InnoDB: syntax error in innodb_data_file_path or>  2017-08-18 05:18:21 23534 Plugin 'InnoDB' init function returned error.
  2017-08-18 05:18:21 23534 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  2017-08-18 05:18:21 23534 Unknown/unsupported storage engine: InnoDB
  2017-08-18 05:18:21 23534 Aborting
  ......................................
  【解决办法】
  # vim /data/3308/my.cnf
  innodb_data_file_path = ibdata1: 12M: autoextend 发现路径中包含有空格,将空格删除就能正常启动!
  # /data/3308/mysql start
  starting mysql…
  # netstat -luntp|grep 330
  tcp6       0      0 :::3308               :::*                  LISTEN      24358/mysqld
  【问题三】初始化mysql时,出现一下报错信息
  # /application/mysql/scripts/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql
  FATAL ERROR: please install the following Perl modules before executing /application/mysql/scripts/mysql_install_db:
  Data::Dumper
  【解决办法】
  # yum -y install autoconf
  【问题四】开机,开启mysql是出现的能够启动mysql,但是不能进入mysql
  # /etc/init.d/mysqld start
  Starting MySQL                                             
  # /etc/init.d/mysqld status
  Multiple MySQL running but PID file could not be found
  【解决办法】
  使用kill -9 PID 杀死mysql的两个进程,然后重新启动mysql

页: [1]
查看完整版本: MySQL使用中遇到的问题及解决办法