max_connect_errors:
the value of the max_connect_errors
system variable determines how many successive interrupted connection requests are permitted. (See Section 5.1.4, “Server System Variables”.) After max_connect_errors
failed requests without a successful connection, mysqld assumes that something is wrong (for example, that someone is trying to break in), and blocks the host from further connections until you issue a FLUSH HOSTS
statement or execute a mysqladmin flush-hosts command.
By default, mysqld blocks a host after 10 connection errors. You can adjust the value by settingmax_connect_errors
at server startup:
shell> mysqld_safe --max_connect_errors=10000 &
The value can also be set at runtime:
mysql> SET GLOBAL max_connect_errors=10000;
If you get the Host '
error message for a given host, you should first verify that there is nothing wrong with TCP/IP connections from that host. If you are having network problems, it does you no good to increase the value of the host_name
' is blockedmax_connect_errors
variable.
To enable multiple tablespaces, start the server with the --innodb_file_per_table
option. For example, add a line to the [mysqld]
section of my.cnf
:
[mysqld] innodb_file_per_table
With multiple tablespaces enabled, InnoDB
stores each newly created table into its own
file in the database directory where the table belongs. This is similar to what the tbl_name
.ibdMyISAM
storage engine does, but MyISAM
divides the table into a
data file and an tbl_name
.MYD
index file. For tbl_name
.MYIInnoDB
, the data and the indexes are stored together in the .ibd
file. The
file is still created as usual.tbl_name
.frm
You cannot freely move .ibd
files between database directories as you can with MyISAM
table files. This is because the table definition that is stored in the InnoDB
shared tablespace includes the database name, and because InnoDB
must preserve the consistency of transaction IDs and log sequence numbers.
If you remove the innodb_file_per_table
line from my.cnf
and restart the server, InnoDB
creates tables inside the shared tablespace files again.
The --innodb_file_per_table
option affects only table creation, not access to existing tables. If you start the server with this option, new tables are created using .ibd
files, but you can still access tables that exist in the shared tablespace. If you start the server without this option, new tables are created in the shared tablespace, but you can still access any tables that were created using multiple tablespaces.
InnoDB
always needs the shared tablespace because it puts its internal data dictionary and undo logs there. The.ibd
files are not sufficient for InnoDB
to operate.
最后这一句话很重要:innodb始终都是需要那个共享表空间的,因为innodb需要把中间数据和undo log放在里面。
query_cache_type and query_cache_size:
query_cache_type=N
N=0 —- 禁用查询缓存的功能;
N=1 —- 启用产讯缓存的功能,缓存所有符合要求的查询结果集,除SELECT SQL_NO_CACHE.., 以及不符合查询缓存设置的结果集外;
N=2 —- 仅仅缓存SELECT SQL_CACHE …子句的查询结果集,除不符合查询缓存设置的结果集外;
query_cache_size
查询缓存设置多大才是合理?至少需要从四个维度考虑:
① 查询缓存区对DDL和DML语句的性能影响;
② 查询缓存区的内部维护成本;
③ 查询缓存区的命中率及内存使用率等综合考虑;
④ 业务类型;