Plugin ‘FEEDBACK’ is disabled

MySQL低版本升级高版本一般会出现Plugin 'FEEDBACK' is disabled这个错误,通常还伴随The InnoDB memory heap is disabled问题一起出现。

如果是The memory heap is disabled错误可以在[mysqld]下方增加"_use_sys_malloc = 1",即使用系统自动分配内存。而Plugin 'FEEDBACK' is disabled只需要在[mysqld]下方增加“feedback=ON”即可开启。

参考MariaDB提供的文档:Feedback Plugin

Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler

mysql迁移至mariadb的时候出现:

Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler

解决办法:

停止MySQL,备份

service mysqld stop
\cp -a /var/lib// /var/lib/mysqlback

移除旧mysql,初始化mysql

继续阅读“Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler”

InnoDB: If you are attempting downgrade from MySQL 5.7.9 or later

: If you are attempting downgrade from 5.7.9 or later

这是一个版本问题,之前安装过mysql 5.7,再回到mariadb 5.5出现的问题。之后我搜了下网上很多人有这个问题。错误全文:

160916 17:03:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/
2016-09-16 17:03:22 139911928530976 [Note] /usr/sbin/mysqld (mysqld 10.1.17-) starting as process 16541 ...
2016-09-16 17:03:22 139911928530976 [Note] : Using mutexes to ref count buffer pool pages
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: Using Linux native AIO
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: Using SSE crc32 instructions
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: Completed initialization of buffer pool
2016-09-16 17:03:22 139911928530976 [Note] InnoDB: Highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If you are attempting downgrade from MySQL 5.7.9 or later,
InnoDB: please refer to http://dev.mysql.com/doc/refman/5.6/en/upgrading-downgrading.html
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/error-creating-innodb.html
2016-09-16 17:03:22 139911928530976 [ERROR] Plugin 'InnoDB' init function returned error.
2016-09-16 17:03:22 139911928530976 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-09-16 17:03:22 139911928530976 [Note] Plugin 'FEEDBACK' is disabled.
2016-09-16 17:03:22 139911928530976 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-09-16 17:03:22 139911928530976 [ERROR] Aborting

160916 17:03:22 mysqld_safe mysqld from pid file /var/lib/mysql/iZ236priv51Z.pid ended

继续阅读“InnoDB: If you are attempting downgrade from MySQL 5.7.9 or later”

MySQL 5.7或者MariaDB经常关闭的解决办法

5.7、MariaDB经常关闭,如果配置没有错,那么大多原因是由于服务器内存不够用,特别是很多云服务器或者VPS都是512MB的内容。针对小内存的服务器可以将数据库的消耗调小即可。

首先备份 /etc/my.cnf

在my.cnf中的[mysqld]下方插入

_buffer_pool_size=5M
_log_buffer_size=256K
query_cache_size=0
max_connections=10
key_buffer_size=8
thread_cache_size=0
host_cache_size=0
_ft_cache_size=1600000
_ft_total_cache_size=32000000

# per thread or per operation settings
thread_stack=131072
sort_buffer_size=32K
read_buffer_size=8200
read_rnd_buffer_size=8200
max_heap_table_size=16K
tmp_table_size=1K
bulk_insert_buffer_size=0
join_buffer_size=128
net_buffer_length=1K
_sort_buffer_size=64K

#settings that relate to the binary log (if enabled)
binlog_cache_size=4K
binlog_stmt_cache_size=4K

重启mysql即可。

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

“Your installation appears to be missing the extension which is required by ”的意思是PHP没有安装MySQL扩展,WordPress需要这个扩展才能运行,这个貌似和我之前提到的“您的PHP似乎没有安装运行WordPress所必需的MySQL扩展”是一个意思,其实不然。

针对低版本的PHP编译的时候带上--with- --with-或者yum安装:yum install -mysql -mysqli即可,但是高版本的PHP已经用php-mysqlnd代替了php-mysql、php-mysqli。那么是不是安装了php-mysqlnd后WordPress就能运行?答案是不定的。

首先,高版本PHP(5.6及其以上)需要安装php-mysqlnd,还要将WordPress升级到 4.3.1才行。

Unknown/unsupported storage engine: InnoDB

5.5以及以上版本出现Unknown/unsupported storage engine: 错误,是由于你的存储引擎使用了,但是数据库默认没有开启innodb

方法一:可以先将数据库改为MyISAM,再将mysql关闭innodb

在my.cnf [mysqld]下增加:

# Disable innodb
default-storage-engine=MyISAM
#default-tmp-storage-engine=MYISAM
loose-skip-innodb
loose-innodb-trx=0 
loose-innodb-locks=0 
loose-innodb-lock-waits=0 
loose-innodb-cmp=0 
loose-innodb-cmp-per-index=0
loose-innodb-cmp-per-index-reset=0
loose-innodb-cmp-reset=0 
loose-innodb-cmpmem=0 
loose-innodb-cmpmem-reset=0 
loose-innodb-buffer-page=0 
loose-innodb-buffer-page-lru=0 
loose-innodb-buffer-pool-stats=0 
loose-innodb-metrics=0 
loose-innodb-ft-default-stopword=0 
loose-innodb-ft-inserted=0 
loose-innodb-ft-deleted=0 
loose-innodb-ft-being-deleted=0 
loose-innodb-ft-config=0 
loose-innodb-ft-index-cache=0 
loose-innodb-ft-index-table=0 
loose-innodb-sys-tables=0 
loose-innodb-sys-tablestats=0 
loose-innodb-sys-indexes=0 
loose-innodb-sys-columns=0 
loose-innodb-sys-fields=0 
loose-innodb-sys-foreign=0 
loose-innodb-sys-foreign-cols=0

方法二:直接mysql启用innodb引擎

在my.cnf [mysqld]下增加:

default-storage-engine=INNODB

注意事项

以上操作都必须关闭mysql再修改my.cnf。

mysql-community-server 5.7设置密码

-community-server 5.7如何设置密码,我们首先尝试:


ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
mysqladmin -u root -password mysql
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)

那是由于mysql-community-server 5.7的密码是一个默认的随机密码,这个初始密码,mysql又不告诉你,我们需要重设这个密码。

首先我们打开两个终端,终端1运行: 继续阅读“mysql-community-server 5.7设置密码”

MySQL Query Cache的简单配置

如果你这样开启了MySQL Query Cache,不难发现,当你的mysql重启的时候,cache大小值就为零了。可以设置一个简单的方法,不用担心mysql重启对cache的影响。

1、开启MySQL Query Cache

2、设置cache大小

在my.cnf的[mysqld]最后,添加两行: 继续阅读“MySQL Query Cache的简单配置”

如何使用MySQL的Query Cache

当前正在学习MySQL,仅以作笔记为目的来总结近来所学,便于以后有用到的时候进行查阅。

故名思义就是用来缓存和查询相关的数据的。

几个重要的MySQL Query Cache参数

> show variables like "%query_cache%";
------------------------------ ---------
| Variable_name                | Value   |
------------------------------ ---------
| have_query_cache             | YES     |
| query_cache_limit            | 1048576 |
| query_cache_min_res_unit     | 4096    |
| query_cache_size             | 0       |
| query_cache_type             | ON      |
| query_cache_wlock_invalidate | OFF     |
------------------------------ ---------
6 rows in set (0.00 sec) 继续阅读“如何使用MySQL的Query Cache”

WordPress缓存优化,就是快

现在装了Zend Opcache之后,博客访问速度又加快了不少。现在维持在15 queries in 0.179 seconds左右。说说我目前达到快速的一些WordPress缓存优化。

1、主题

首先写主题的时候必须是精简,一些php语法和WP标签需要去研究,这个我就不细说,有空咱们再一起交流。

2、object cache

WordPress启用了object cache,这是WordPress对象缓存,相当有效。 继续阅读“WordPress缓存优化,就是快”