mysql报错

1. 环境说明

CentOS 6.5

[[email protected] ~]# 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

[[email protected] ~]# 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

保存退出,重新启动:

[[email protected] 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).

报错!!!

查看错误日志:

[[email protected] data]# vim /tmp/mysql_oldboy3306.err

2017-08-12 18:13:18 28414 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 768 pages (rounded down to MB) than specified

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试试

[[email protected] data]# /etc/init.d/mysqld start

Starting MySQL.. SUCCESS!

成功启动!!!

时间: 2024-10-11 05:17:18

mysql报错的相关文章

mysql报错问题解决Character set 'utf8mb4' is not a compiled character set

mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file 报错的解决方法 1.由于日常程序使用了字符集utf8mb4,为了避免每次更新时,set names utf8mb4,就把配置文件改了,如下: 增加了mysql客户端的默认字符集设置 [[email protected]~]# vim

解决mysql报错Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

启动mysql 报错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 1.先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动.另外看看是不是权限问题. 2.确定你的mysql.sock是不是在那个位置,mysql -u 你的mysql用户名 -p -S /var/lib/mysql/

MySQL报错“1366 - Incorrect integer value: '' XXXXXXX' at row 1 ”

出现这个错误是因为我在表中插入了一条含有中文字符的语句: 修改方法: my.ini中查找sql-mode 将 sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION", 修改为 sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION", 重启mysql后即可 . MySQL报错"1366 - Incorrect int

mysql报错:MySQL server version for the right syntax to use near 'type=InnoDB'

工作中使用sql语句建表时,mysql报了如下错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 1 解决方案: 这个报错是由于某些版本的mysql不支持type写法,将type关键词改成ENGINE 即可. 版权声明:本文为博主原

连接mysql报错:error 2003 (hy000):can't connect to mysql server on 'localhost' (10061)

一.mysql 的bin目录下有个MySQLInstanceConfig.exe,运行就可以进行创建数据库实例,创建实例时也可以生成windows 服务,把服务设置成自动启动就可以了 二.安装在D盘的discuzz!打开后出现上述错误,请问应如何处理?winmysqladmin已经启动,但三色树上有一个小红点如果出现"ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)",说明你的MySQL还没有启动.解决办法

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with 摘要 Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with... Linux系统下装完MySQL,然后重启动时报错: 解决方法:  查看cat /etc/h

Mysql报错Forcing close of thread 139 user: 'root'

最近重启服务器的mysql总是报大量的如下错误: 160330  9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 139  user: 'root' 160330  9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 138  user: 'root' 160330  9:14:26 [Warning] /usr/libexec/mysqld: 

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with 摘要 Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with... Linux系统下装完MySQL,然后重新启动动时报错: 解决方法:  查看cat /etc

一看便知linux下mysql报错ERROR 1044: Access denied for user: '@localhost' to database 'mysql'

错误信息:ERROR 1044: Access denied for user: '@localhost' to database 'mysql' linux下解决方案: mysql> use mysql ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'mysql' mysql> exit Bye [[email protected] ~]# service mysqld stop如果该命令不

在CentOS中安装32位或64位MySql报错error: Failed dependencies解决办法

在CentOS中安装MySql报错error: Failed dependencies解决办法 安装64位MySql报错内容如下:error: Failed dependencies:        libaio.so.1()(64bit) is needed by MySQL-server-5.6.19-1.el6.x86_64    libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.19-1.el6.x86_64