mysql
shell> mysqld --verbose --help
abort-slave-event-count 0 allow-suspicious-udfs FALSE archive ON auto-increment-increment 1 auto-increment-offset 1 autocommit TRUE automatic-sp-privileges TRUE avoid-temporal-upgrade FALSE back-log 80 basedir /home/jon/bin/mysql-8.0/ ... tmpdir /tmp transaction-alloc-block-size 8192 transaction-isolation REPEATABLE-READ transaction-prealloc-size 4096 transaction-read-only FALSE transaction-write-set-extraction OFF updatable-views-with-limit YES validate-user-plugins TRUE verbose TRUE wait-timeout 28800
mysql> SHOW VARIABLES;
mysql> SHOW STATUS;
shell>mysqladmin variables
shell>mysqladmin extended-status
my.ini
.ini
#
#
mysqld
mysqld
mysqld
[mysqld]
[mysqld]
[mysqld_safe]
[mysqld]
mysqld --help
mysqld --verbose --help
SHOW VARIABLES
SHOW
VARIABLES
/var/mysql/data
--
var_name
=value
--sort_buffer_size=384M
sort_buffer_size
SET
var_name
=value
SET
--help
--help |
--allow-suspicious-udfs | |
FALSE |
xxx
--ansi |
--sql-mode
--basedir=
dir_name
-b
dir_name
--basedir=dir_name | |
basedir | |
parent of mysqld installation directory | |
configuration-dependent default |
basedir
basedir
basedir
--big-tables | |
big_tables | |
OFF |
--bind-address=addr | |
bind_address | |
* |
--bind-address
--bind-address
0.0.0.0
--bind-address
0.0.0.0
*
0.0.0.0
::
::ffff:127.0.0.1
--host=127.0.0.1
--host=::ffff:127.0.0.1
127.0.0.1
--bind-address=*
*
--bind-address=198.51.100.20
198.51.100.20
--bind-address=198.51.100.20,2001:db8:0:f101::1
198.51.100.20
--bind-address=198.51.100.20,*
--bind-address
--bind-address
--bind-address
mysql.user
::1
mysql.user
--binlog-format={ROW|STATEMENT|MIXED}
--binlog-format=format | |
binlog_format | |
ROW | |
|
binlog_format
--character-sets-dir=dir_name | |
character_sets_dir | |
--character-set-client-handshake
--character-set-client-handshake | |
TRUE |
--skip-character-set-client-handshake
--character-set-filesystem=
charset_name
--character-set-filesystem=name | |
character_set_filesystem | |
binary |
character_set_filesystem
--character-set-server=
charset_name
charset_name
--character-set-server | |
character_set_server | |
utf8mb4 | |
latin1 |
charset_name
--collation-server
--chroot=
dir_name
dir_name
--chroot=dir_name | |
chroot()
LOAD DATA
INFILE
SELECT ... INTO
OUTFILE
--collation-server=
collation_name
--collation-server | |
collation_server | |
utf8mb4_0900_ai_ci | |
latin1_swedish_ci |
collation_name
--console | |
--console
--log-error
--core-file | |
OFF |
core.
pid
pid
pid
--core-file-size
--user
--daemonize[={OFF|ON}] | |
OFF |
--daemonize
--initialize
--initialize-insecure
--daemonize
--log-error=""
-D
--daemonize
--datadir=
dir_name
dir_name
datadir
--debug[=
debug_options
]debug_options
--debug[=debug_options] | |
debug | |
d:t:i:O,\mysqld.trace | |
d:t:i:o,/tmp/mysqld.trace |
-DWITH_DEBUG=1
debug_options
file_name
d:t:i:O,\mysqld.trace
-DWITH_DEBUG=1
--debug="d,parser_debug"
+
--debug=T
--debug=+P
--debug-sync-timeout[=#] | |
-DENABLE_DEBUG_SYNC=1
--default-storage-engine=name | |
default_storage_engine | |
InnoDB |
TEMPORARY
default_tmp_storage_engine
TEMPORARY
--default-time-zone=name | |
time_zone
system_time_zone
--defaults-extra-file=
file_name
file_name
file_name
--defaults-file
mysqld-auto.cnf
--defaults-file
--install
--install-manual
--install
--install-manual
str
[mysqld]
--defaults-group-suffix=_other
[mysqld_other]
--delay-key-write[={OFF|ON|ALL}]
--delay-key-write[=name] | |
delay_key_write | |
ON | |
|
MyISAM
ON
ALL
ALL
--des-key-file=file_name | |
--early-plugin-load=
plugin_list
--early-plugin-load=plugin_list | |
empty string |
--early-plugin-load
name
=
plugin_library
plugin_library
name
plugin_library
plugin_dir
myplug1
myplug1.so
shell> mysqld --early-plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"
;
--early-plugin-load
--initialize
--initialize-insecure
--early-plugin-load
--help
--early-plugin-load
--early-plugin-load
--early-plugin-load
InnoDB
keyring_file
keyring_file
keyring_file.dll
InnoDB
--enable-named-pipe | |
--event-scheduler[=value] | |
event_scheduler | |
ON | |
OFF | |
|
--event-scheduler
--exit-info[=
flags
]flags
--exit-info[=flags] | |
--external-locking | |
FALSE |
lockd
--skip-external-locking
MyISAM
--flush
flush_time
flush_time
--gdb | |
FALSE |
SIGINT
^C
RESTART
--gdb
RESTART
--no-monitor
--general-log | |
general_log | |
OFF |
--general-log
--initialize | |
OFF |
mysql
--initialize
disabled_storage_engines
--initialize
--daemonize
-I
--initialize
--initialize-insecure | |
OFF |
mysql
--initialize
--initialize
--initialize-insecure
CREATE USER
GRANT
--innodb-
xxx
InnoDB
--install [service_name] | |
MySQL
service_name
--defaults-file
--install
--install
--install-manual
[
service_name
]
--install-manual [service_name] | |
MySQL
service_name
--defaults-file
--install-manual
--install-manual
--language=
lang_name
,
-L lang_name
--language=name | |
lc-messages-dir | |
language | |
/usr/local/mysql/share/mysql/english/ |
lang_name
--lc-messages-dir
--lc-messages
--language
--lc-messages-dir
--language
--large-pages | |
large_pages | |
FALSE |
--super-large-pages
--large-pages
--lc-messages=name | |
lc_messages | |
en_US |
en_US
--lc-messages-dir
--lc-messages-dir=dir_name | |
lc_messages_dir | |
--lc-messages
--local-service |
--local-service
--defaults-file
host_name
.err--pid-file
.err
--console
--log-error
--log-isam[=file_name] | |
MyISAM
--log-output=name | |
log_output | |
FILE | |
|
TABLE
NONE
general_log
mysql
NONE
TABLE
--general_log
--slow_query_log
--general_log_file
--log-queries-not-using-indexes
--log-queries-not-using-indexes | |
log_queries_not_using_indexes | |
OFF |
--log-raw[=value] | |
OFF |
--log-raw
--log-raw
--log-short-format | |
FALSE |
--log-tc=file_name | |
tc.log |
tc.log
--log-tc-size=# | |
6 * page size | |
6 * page size | |
18446744073709551615 | |
4294967295 |
--log-warnings[=
level
]level
--log-warnings[=#] | |
log_warnings | |
2 | |
0 | |
18446744073709551615 | |
4294967295 |
log_error_verbosity
--low-priority-updates | |
low_priority_updates | |
FALSE |
INSERT
REPLACE
DELETE
UPDATE
SET
LOW_PRIORITY_UPDATES=1
MEMORY
--min-examined-row-limit=
number
--min-examined-row-limit=# | |
min_examined_row_limit | |
0 | |
0 | |
18446744073709551615 | |
4294967295 |
number
--memlock | |
FALSE |
--memlock
mlockall()
shell> grep mlockall /usr/include/sys/mman.h
mlockall()
mlockall外部中断(INT _ _旗)_ _ throw;
root
root
mlockall()
--myisam-block-size=# | |
1024 | |
1024 | |
16384 |
MyISAM
--myisam-recover-options[=
option
[,option
]...]]
--myisam-recover-options[=name] | |
OFF | |
|
MyISAM
DEFAULT
FORCE
DEFAULT
OFF
MyISAM
OFF | |
DEFAULT | |
BACKUP |
|
FORCE | .MYD |
QUICK |
BACKUP,FORCE
--no-defaults
--no-dd-upgrade | |
FALSE |
--no-dd-upgrade
--no-monitor | |
FALSE |
RESTART
RESTART
--no-monitor
--gdb
--old-alter-table | |
old_alter_table | |
OFF |
ALTER
TABLE
ALTER TABLE
--old-style-user-limits | |
FALSE |
user
--open-files-limit=# | |
open_files_limit | |
5000, with possible adjustment | |
0 | |
platform dependent |
Too many open files
setrlimit()
max_connections
table_open_cache
--performance-schema-xxx
host_name
.pidhost_name
--plugin
--innodb_file_per_table
--plugin-innodb_file_per_table
--skip
--skip-plugin-innodb_file_per_table
innodb_file_per_table
--plugin
--sql-mode
--plugin
--plugin-load=plugin_list | |
--plugin-load
--plugin-load-add
name
=
plugin_library
plugin_library
name
plugin_library
plugin_dir
myplug1
myplug1.so
shell> mysqld --plugin-load="myplug1=myplug1.so;myplug2=myplug2.so"
;
--plugin-load
INSTALL PLUGIN
mysql.plugins
--skip-grant-tables
--plugin-load
--skip-grant-tables
--plugin-load
--plugin-load-add=plugin_list | |
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load
--plugin-load=x --plugin-load-add=y
--plugin-load="x;y"
--plugin-load-add=y --plugin-load=x
--plugin-load=x
--port=
port_num
port_num
root
--port-open-timeout=# | |
0 |
--defaults-file
--defaults-extra-file
--remove [service_name] | |
MySQL
service_name
--safe-user-create | |
FALSE |
GRANT
INSERT
GRANT INSERT(user) ON mysql.user TO 'user_name
'@'host_name
';
GRANT
--secure-auth | |
secure_auth | |
ON | |
ON |
--secure-file-priv=dir_name | |
secure_file_priv | |
platform specific | |
|
secure_file_priv
LOAD DATA
SELECT ... INTO
OUTFILE
LOAD_FILE()
secure_file_priv
--shared-memory[={0,1}] | |
shared_memory | |
FALSE |
--shared-memory-base-name=
name
--shared-memory-base-name=name | |
shared_memory_base_name | |
MYSQL |
MYSQL
MyISAM
|
OFF
--event-scheduler=DISABLED
--event-scheduler
--skip-grant-tables | |
FALSE |
FLUSH PRIVILEGES
--skip-grant-tables
--skip-networking
INSTALL PLUGIN
--plugin-load
--skip-grant-tables
disabled_storage_engines
FLUSH PRIVILEGES
--skip-host-cache |
--skip-host-cache
host_cache_size
host_cache_size
--skip-host-cache
host_cache_size
host_cache_size
InnoDB
InnoDB
--default-storage-engine
--default-tmp-storage-engine
InnoDB
--skip-innodb
--skip-name-resolve | |
skip_name_resolve | |
OFF |
Host
Host
--host=127.0.0.1
--host=::1
127.0.0.1
--skip-name-resolve
--host=127.0.0.1
--host=::1
CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'root-password
'; CREATE USER 'root'@'::1' IDENTIFIED BY 'root-password
';
--skip-networking | |
skip_networking | |
--skip-grant-tables
--skip-networking
--ssl
--standalone | |
--super-large-pages | |
FALSE |
--super-large-pages
--skip-super-large-pages
--symbolic-links
--skip-symbolic-links
--symbolic-links | |
OFF | |
ON |
MyISAM
DATA DIRECTORY
CREATE TABLE
--symbolic-links
have_symlink
--skip-show-database | |
skip_show_database | |
skip_show_database
SHOW DATABASES
--skip-stack-trace |
--slow-query-log | |
slow_query_log | |
OFF |
--slow-query-log
--slow-start-timeout=# | |
15000 |
--socket={file_name|pipe_name} | |
socket | |
/tmp/mysql.sock | |
MySQL |
/tmp/mysql.sock
--sql-mode=
value
[,value
[,value
...]]
--sql-mode=name | |
sql_mode | |
ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_ENGINE_SUBSTITUTION | |
ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION | |
| |
| |
|
--sysdate-is-now | |
FALSE |
SYSDATE()
NOW()
SYSDATE()
NOW()
SYSDATE()
SET
TIMESTAMP
--tc-heuristic-recover={COMMIT|ROLLBACK}
--tc-heuristic-recover=name | |
COMMIT | |
|
--temp-pool | |
FALSE | |
TRUE |
--transaction-isolation=name | |
transaction_isolation | |
REPEATABLE-READ | |
|
level
READ-UNCOMMITTED
READ-COMMITTED
REPEATABLE-READ
SERIALIZABLE
SET
TRANSACTION
transaction_isolation
--transaction-read-only | |
transaction_read_only | |
OFF |
SET TRANSACTION
transaction_read_only
--tmpdir=
dir_name
dir_name
/tmp
;
--tmpdir
LOAD DATA
INFILE
--user={
user_name
|user_id
}user_name
user_id
--user=name | |
user_name
user_id
root
--user=root
root
--user
--user
$MYSQL_HOME/my.cnf
--user
root
--user
--user
--help
SET
SYSTEM_VARIABLES_ADMIN
SUPER
mysqld --verbose --help
mysqld --no-defaults --verbose --help
SHOW VARIABLES
InnoDB
SET
1
0
TRUE
FALSE
0
/var/mysql/data
--activate-all-roles-on-login | |
activate_all_roles_on_login | |
OFF |
activate_all_roles_on_login
SET DEFAULT
ROLE
activate_all_roles_on_login
SET DEFAULT
ROLE
mandatory_roles
activate_all_roles_on_login
SET ROLE
SET ROLE
authentication_windows_log_level
--authentication-windows-log-level | |
0 | |
0 | |
4 |
authentication_windows
authentication_windows_use_principal_name
--authentication-windows-use-principal-name | |
ON |
authentication_windows
InitSecurityContext()
targetName
user_id
computer_name
0x00
targetName
--autocommit[=#] | |
autocommit | |
ON |
COMMIT
ROLLBACK
autocommit
COMMIT
START
TRANSACTION
BEGIN
autocommit
autocommit
--autocommit=0
[mysqld]autocommit=0
automatic_sp_privileges | |
TRUE |
EXECUTE
ALTER ROUTINE
ALTER ROUTINE
automatic_sp_privileges
CREATE
--auto-generate-certs[={OFF|ON}] | |
auto_generate_certs | |
ON |
auto_generate_certs
--ssl
sha256_password_auto_generate_rsa_keys
caching_sha2_password_auto_generate_rsa_keys
--avoid-temporal-upgrade={OFF|ON} | |
avoid_temporal_upgrade | |
OFF |
ALTER
TABLE
TIME
DATETIME
TIMESTAMP
ALTER TABLE
back_log
listen()
back_log
max_connections
--basedir=dir_name | |
basedir | |
parent of mysqld installation directory | |
configuration-dependent default |
--big-tables | |
big_tables | |
OFF |
The table
tbl_name
is
fullSELECT
TempTable
TempTable
--bind-address=addr | |
bind_address | |
* |
--bind-address
--block-encryption-mode=# | |
block_encryption_mode | |
aes-128-ecb |
AES_ENCRYPT()
AES_DECRYPT()
block_encryption_mode
keylen
mode
keylen
mode
keylen
mode
CBC
CFB8
OFB
mode
CBC
SET block_encryption_mode = 'aes-256-cbc';
block_encryption_mode
--bulk-insert-buffer-size=# | |
bulk_insert_buffer_size | |
8388608 | |
0 | |
18446744073709551615 | |
4294967295 |
MyISAM
INSERT ...
SELECT
LOAD DATA
INFILE
caching_sha2_password_auto_generate_rsa_keys
--caching-sha2-password-auto-generate-rsa-keys[={OFF|ON}] | |
caching_sha2_password_auto_generate_rsa_keys | |
ON |
sha256_password_auto_generate_rsa_keys
caching_sha2_password_auto_generate_rsa_keys
caching_sha2_password
auto_generate_certs
caching_sha2_password_private_key_path
--caching-sha2-password-private-key-path=file_name | |
caching_sha2_password_private_key_path | |
private_key.pem |
caching_sha2_password
caching_sha2_password
caching_sha2_password_public_key_path
--caching-sha2-password-public-key-path=file_name | |
caching_sha2_password_public_key_path | |
public_key.pem |
caching_sha2_password
caching_sha2_password
character_set_client | |
utf8mb4 | |
utf8 |
--default-character-set
sjis
--skip-character-set-client-handshake
ucs2
utf16le
SET
NAMES
SET CHARACTER
SET
character_set_connection | |
utf8mb4 | |
utf8 |
character_set_database | |
utf8mb4 | |
latin1 | |
character_set_server
character_set_database
collation_database
character_set_database
collation_database
--character-set-filesystem=name | |
character_set_filesystem | |
binary |
LOAD DATA
INFILE
SELECT ... INTO
OUTFILE
LOAD_FILE()
character_set_client
character_set_filesystem
character_set_filesystem
character_set_results | |
utf8mb4 | |
utf8 |
--character-set-server | |
character_set_server | |
utf8mb4 | |
latin1 |
character_set_system | |
utf8 |
utf8
--character-sets-dir=dir_name | |
character_sets_dir | |
--check-proxy-users=[={OFF|ON}] | |
check_proxy_users | |
OFF |
mysql_native_password
check_proxy_users
mysql_native_password
mysql_native_password_proxy_users
sha256_password
sha256_password_proxy_users
collation_connection | |
collation_database | |
utf8mb4_0900_ai_ci | |
latin1_swedish_ci | |
collation_server
character_set_database
collation_database
character_set_database
collation_database
--collation-server | |
collation_server | |
utf8mb4_0900_ai_ci | |
latin1_swedish_ci |
--completion-type=# | |
completion_type | |
NO_CHAIN | |
|
NO_CHAIN | COMMIT ROLLBACK |
CHAIN | COMMIT ROLLBACK
ROLLBACK AND CHAIN |
RELEASE | COMMIT ROLLBACK
ROLLBACK RELEASE |
completion_type
START
TRANSACTION
BEGIN
COMMIT
ROLLBACK
XA
COMMIT
XA
ROLLBACK
autocommit=1
--concurrent-insert[=#] | |
concurrent_insert | |
AUTO | |
|
AUTO
INSERT
SELECT
--skip-new
NEVER | |
AUTO | MyISAM |
ALWAYS | MyISAM |
--connect-timeout=# | |
connect_timeout | |
10 | |
2 | |
31536000 |
Bad handshake
connect_timeout
XXX
errno
--core-file
--cte-max-recursion-depth=# | |
cte_max_recursion_depth | |
1000 | |
0 | |
4294967295 |
datadir
--debug[=debug_options] | |
debug | |
d:t:i:O,\mysqld.trace | |
d:t:i:o,/tmp/mysqld.trace |
--debug
SYSTEM_VARIABLES_ADMIN
SUPER
+
mysql>SET debug = 'T';
mysql>SELECT @@debug;
+---------+ | @@debug | +---------+ | T | +---------+ mysql>SET debug = '+P';
mysql>SELECT @@debug;
+---------+ | @@debug | +---------+ | P:T | +---------+ mysql>SET debug = '-P';
mysql>SELECT @@debug;
+---------+ | @@debug | +---------+ | T | +---------+
debug_sync | |
-DENABLE_DEBUG_SYNC=1
debug_sync
--debug-sync-timeout=
N
N
debug_sync
N
SYSTEM_VARIABLES_ADMIN
SUPER
--default-authentication-plugin=plugin_name | |
default_authentication_plugin | |
caching_sha2_password | |
mysql_native_password | |
| |
|
mysql_native_password
sha256_password
caching_sha2_password
caching_sha2_password
default_authentication_plugin
CREATE USER
GRANT
CREATE USER ... IDENTIFIED BY 'cleartext password
';
default_collation_for_utf8mb4 | |
|
utf8mb4
utf8mb4
utf8mb4_0900_ai_ci
utf8mb4
CREATE TABLE
ALTER TABLE
COLLATION
CREATE DATABASE
ALTER DATABASE
COLLATION
_utf8mb4'
some
text
'
--default-password-lifetime=# | |
default_password_lifetime | |
0 | |
0 | |
65535 |
default_password_lifetime
default_password_lifetime
N
N
CREATE USER
ALTER USER
--default-storage-engine=name | |
default_storage_engine | |
InnoDB |
TEMPORARY
default_tmp_storage_engine
SHOW ENGINES
ENGINES
TEMPORARY
--default-tmp-storage-engine=name | |
default_tmp_storage_engine | |
InnoDB |
TEMPORARY
CREATE TEMPORARY
TABLE
default_storage_engine
TEMPORARY
--default-week-format=# | |
default_week_format | |
0 | |
0 | |
7 |
WEEK()
--delay-key-write[=name] | |
delay_key_write | |
ON | |
|
MyISAM
CREATE TABLE
OFF | DELAY_KEY_WRITE |
ON | DELAY_KEY_WRITE CREATE TABLE |
ALL | DELAY_KEY_WRITE |
DELAY_KEY_WRITE
--myisam-recover-options
--myisam-recover-options=BACKUP,FORCE
--external-locking
--delayed-insert-limit=# | |
delayed_insert_limit | |
100 | |
1 | |
18446744073709551615 | |
4294967295 |
DELAYED
--delayed-insert-timeout=# | |
delayed_insert_timeout | |
300 |
DELAYED
--delayed-queue-size=# | |
delayed_queue_size | |
1000 | |
1 | |
18446744073709551615 | |
4294967295 |
DELAYED
--disabled-storage-engines=engine[,engine]... | |
disabled_storage_engines | |
empty string |
MyISAM
[mysqld] disabled_storage_engines="MyISAM,FEDERATED"
disabled_storage_engines
CREATE
TABLE
CREATE
TABLESPACE
ALTER TABLE ...
ENGINE
ALTER
TABLESPACE ... ENGINE
ER_DISABLED_STORAGE_ENGINE
disabled_storage_engines
CREATE INDEX
TRUNCATE TABLE
ANALYZE TABLE
DROP TABLE
DROP TABLESPACE
ALTER TABLE ...
ENGINE
permitted_engine
default_storage_engine
default_tmp_storage_engine
disabled_storage_engines
--initialize-insecure
disconnect_on_expired_password
--disconnect-on-expired-password[=#] | |
disconnect_on_expired_password | |
ON |
disconnect_on_expired_password
disconnect_on_expired_password
disconnect_on_expired_password
disconnect_on_expired_password
--div-precision-increment=# | |
div_precision_increment | |
4 | |
0 | |
30 |
/
MySQL的> SELECT 1/7;
-------- | 7 1 / | -------- | 0.1429 | -------- MySQL > SET div_precision_increment = 12;
MySQL的> SELECT 1/7;
---------------- | 1/7 | ---------------- | 0.142857142857 | ----------------
dragnet.log_error_filter_rules
--dragnet.log-error-filter-rules | |
dragnet.log_error_filter_rules | |
IF prio>=INFORMATION THEN drop. IF EXISTS source_line THEN unset source_line. |
log_filter_dragnet
dragnet.log_error_filter_rules
dragnet.log_error_filter_rules
dragnet.Status
dragnet.log_error_filter_rules
dragnet.log_error_filter_rules
MySQL的> SET GLOBAL dragnet.log_error_filter_rules = 'IF prio <> 0 THEN unset prio.';
查询行,0行的影响,1报警(0秒)MySQL > SHOW WARNINGS\G
*************************** 1. row *************************** Level: Note Code: 4569Message: filter configuration accepted: SET @@global.dragnet.log_error_filter_rules= 'IF prio!=ERROR THEN unset prio.';
SHOW
WARNINGS
dragnet.log_error_filter_rules
<>
!=
ERROR
end_markers_in_json | |
OFF |
eq_range_index_dive_limit | |
200 | |
0 | |
4294967295 |
col_name
col_name
在( val1
,…, valN
) col_name
=val1
或或 col_name
=valN
N
eq_range_index_dive_limit
eq_range_index_dive_limit
N
eq_range_index_dive_limit
N
N
eq_range_index_dive_limit
ANALYZE TABLE
--event-scheduler[=value] | |
event_scheduler | |
ON | |
OFF | |
|
ON
DISABLED
explicit_defaults_for_timestamp
--explicit-defaults-for-timestamp=# | |
explicit_defaults_for_timestamp | |
ON | |
OFF |
NULL
TIMESTAMP
explicit_defaults_for_timestamp
explicit_defaults_for_timestamp
explicit_defaults_for_timestamp
TIMESTAMP
TIMESTAMP
NOT
NULL
TIMESTAMP
DEFAULT
DEFAULT CURRENT_TIMESTAMP
TIMESTAMP
DEFAULT
'0000-00-00
00:00:00'
NO_ZERO_DATE
TRADITIONAL
NO_ZERO_DATE
explicit_defaults_for_timestamp
TIMESTAMP
TIMESTAMP
CURRENT_TIMESTAMP
NOW()
TIMESTAMP
NULL
NULL
TIMESTAMP
NULL
'0000-00-00
00:00:00'
TIMESTAMP
DEFAULT
DATETIME
TIMESTAMP
ON UPDATE
CURRENT_TIMESTAMP
explicit_defaults_for_timestamp
[警告]与隐式的默认值的时间戳是过时的。请使用explicit_defaults_for_timestamp服务器选项(详情seedocumentation)。
explicit_defaults_for_timestamp
explicit_defaults_for_timestamp
TIMESTAMP
explicit_defaults_for_timestamp
external_user | |
NULL
ON
ON
--flush
flush
flush_time
flush_time
--flush-time=# | |
flush_time | |
0 | |
0 |
flush_time
flush
flush_time
flush_time
foreign_key_checks | |
1 |
InnoDB
ALTER TABLE
InnoDB
foreign_key_checks
DROP
SCHEMA
DROP TABLE
foreign_key_checks
foreign_key_checks = 0
foreign_key_checks=0
--ft-boolean-syntax=name | |
ft_boolean_syntax | |
+ -><()~*:""&| |
IN BOOLEAN MODE
'+ -><()~*:""&|'
:
|
--ft-max-word-len=# | |
ft_max_word_len | |
10 |
MyISAM
FULLTEXT
REPAIR TABLE
tbl_name
QUICK
--ft-min-word-len=# | |
ft_min_word_len | |
4 | |
1 |
MyISAM
FULLTEXT
REPAIR TABLE
tbl_name
QUICK
--ft-query-expansion-limit=# | |
ft_query_expansion_limit | |
20 | |
0 | |
1000 |
WITH QUERY EXPANSION
--ft-stopword-file=file_name | |
ft_stopword_file | |
MyISAM
storage/myisam/ft_static.c
FULLTEXT
REPAIR TABLE
tbl_name
QUICK
--general-log | |
general_log | |
OFF |
OFF
--general_log
log_output
--general-log-file=file_name | |
general_log_file | |
host_name.log |
host_name
.log--general_log_file
--group-concat-max-len=# | |
group_concat_max_len | |
1024 | |
4 | |
18446744073709551615 | |
4294967295 |
GROUP_CONCAT()
YES
NO
COMPRESS()
UNCOMPRESS()
YES
NO
--plugin-load
INSTALL
PLUGIN
YES
have_ssl
YES
profiling
have_query_cache
YES
NO
YES
NO
--ssl-
xxx
have_statement_timeout | |
NO
YES
DATA DIRECTORY
--skip-symbolic-links
--symbolic-links
have_symlink
histogram_generation_max_mem_size
--histogram-generation-max-mem-size=# | |
histogram_generation_max_mem_size | |
20000000 | |
1000000 | |
18446744073709551615 | |
4294967295 |
SYSTEM_VARIABLES_ADMIN
SUPER
host_cache_size | |
-1 | |
0 | |
65536 |
FLUSH HOSTS
host_cache
max_connections
max_connections
--skip-host-cache
host_cache_size
host_cache_size
--skip-host-cache
host_cache_size
host_cache_size
last_insert_id
SET identity
--init-connect=name | |
init_connect | |
autocommit
init_connect
SET GLOBAL init_connect='SET autocommit=0';
init_connect
[mysqld]init_connect='SET autocommit=0'
CONNECTION_ADMIN
SUPER
init_connect
init_connect
init_connect
CONNECTION_ADMIN
SUPER
init_connect
init_connect
init_connect
init_connect
init_connect
information_schema_stats_expiry
--information-schema-stats-expiry=value | |
information_schema_stats_expiry | |
86400 | |
0 | |
31536000 |
INFORMATION_SCHEMA
statistics.cardinalitytables.auto_increment tables.avg_row_length tables.checksum tables.check_time tables.create_time tables.data_free tables.data_length tables.index_length tables.max_data_length tables.table_rows tables.update_time
mysql.index_stats
mysql.index_stats
information_schema_stats_expiry
ANALYZE TABLE
information_schema_stats_expiry
mysql.index_stats
information_schema_stats_expiry
read_only
super_read_only
transaction_read_only
innodb_read_only
information_schema_stats_expiry
--init-file
--init-file
innodb_
xxx
InnoDB
InnoDB
INSERT
ALTER TABLE
--interactive-timeout=# | |
interactive_timeout | |
28800 | |
1 |
CLIENT_INTERACTIVE
mysql_real_connect()
wait_timeout
internal_tmp_disk_storage_engine
--internal-tmp-disk-storage-engine=# | |
internal_tmp_disk_storage_engine | |
INNODB | |
|
MYISAM
internal_tmp_disk_storage_engine
internal_tmp_disk_storage_engine=INNODB
InnoDB
internal_tmp_disk_storage_engine
internal_tmp_mem_storage_engine
--internal-tmp-mem-storage-engine=# | |
internal_tmp_mem_storage_engine | |
TempTable | |
|
TempTable
internal_tmp_mem_storage_engine
--join-buffer-size=# | |
join_buffer_size | |
262144 | |
128 | |
18446744073709547520 | |
4294967295 | |
4294967295 |
join_buffer_size
join_buffer_size
join_buffer_size
--keep-files-on-create=# | |
keep_files_on_create | |
OFF |
MyISAM
.MYD
.MYD
INDEX
DIRECTORY
keep_files_on_create
MyISAM
MyISAM
INDEX
DIRECTORY
.MYI
--key-buffer-size=# | |
key_buffer_size | |
8388608 | |
8 | |
OS_PER_PROCESS_LIMIT | |
4294967295 |
MyISAM
key_buffer_size
key_buffer_size
MyISAM
MyISAM
LOCK TABLES
SHOW STATUS
Key_read_requests
Key_reads
Key_write_requests
Key_writes
Key_reads/Key_read_requests
DELAY_KEY_WRITE
key_buffer_size
Key_blocks_unused
key_cache_block_size
1((key_blocks_unused * key_cache_block_size)/ key_buffer_size)
MyISAM
--key-cache-age-threshold=# | |
key_cache_age_threshold | |
300 | |
100 | |
18446744073709551615 | |
4294967295 |
--key-cache-block-size=# | |
key_cache_block_size | |
1024 | |
512 | |
16384 |
--key-cache-division-limit=# | |
key_cache_division_limit | |
100 | |
1 | |
100 |
large_files_support | |
--large-pages | |
large_pages | |
FALSE |
--large-pages
large_page_size | |
0 |
LAST_INSERT_ID()
LAST_INSERT_ID()
mysql_insert_id()
--lc-messages=name | |
lc_messages | |
en_US |
en_US
lc_messages_dir
--lc-messages-dir=dir_name | |
lc_messages_dir | |
lc_messages
lc_time_names | |
DATE_FORMAT()
DAYNAME()
MONTHNAME()
'pt_BR'
local_infile | |
OFF | |
ON |
LOCAL
LOAD DATA
local_infile
LOAD DATA
LOCAL
local_infile
local_infile
--lock-wait-timeout=# | |
lock_wait_timeout | |
31536000 | |
1 | |
31536000 |
LOCK TABLES
FLUSH TABLES WITH READ LOCK
HANDLER
mysql
GRANT
REVOKE
SELECT
UPDATE
lock_wait_timeout
ER_LOCK_WAIT_TIMEOUT
lock_wait_timeout
LOCK
INSTANCE FOR BACKUP
locked_in_memory | |
stderr
log_error
--log-error-filter-rules | |
log_error_filter_rules | |
set by server |
--log-error-services | |
log_error_services | |
log_filter_internal; log_sink_internal |
log_error_services
INSTALL COMPONENT
--log-error-suppression-list=value | |
log_error_suppression_list | |
empty string |
WARNING
MY-
3100031my - 31my _服务器shutdown - 00031er _ _完整
log_error_suppression_list
WARNING
ERROR
log_error_suppression_list
log_error_verbosity
[mysqld]log_error_verbosity=2 # error and warning messages onlylog_error_suppression_list='10000,10001,MY-10002'
log_error_verbosity
log_error_suppression_list
log_error_verbosity
log_error_verbosity
log_error_suppression_list
[mysqld] log_error_verbosity=1 # error messages only
log_error_verbosity
INFORMATION
log_error_suppression_list
log_error_verbosity
log_error_suppression_list
log_error_verbosity
log_filter_dragnet
--log-error-verbosity=# | |
log_error_verbosity | |
2 | |
3 | |
1 | |
3 |
log_filter_internal
log_error_verbosity
log_error_verbosity
log_error_verbosity
log_error_suppression_list
--log-output=name | |
log_output | |
FILE | |
|
TABLE
NONE
NONE
log_output
--log-queries-not-using-indexes | |
log_queries_not_using_indexes | |
OFF |
log_slow_admin_statements | |
OFF |
ALTER TABLE
ANALYZE TABLE
CHECK TABLE
CREATE INDEX
DROP INDEX
OPTIMIZE TABLE
REPAIR TABLE
--log-syslog[={0|1}] | |
log_syslog | |
ON | |
OFF | |
ON |
syslog
log_sink_syseventlog
log_syslog
log_syslog
--log-syslog-facility=value | |
log_syslog_facility | |
daemon |
syseventlog.facility
--log-syslog-include-pid[={0|1}] | |
log_syslog_include_pid | |
ON |
syseventlog.include_pid
--log-syslog-tag=tag | |
log_syslog_tag | |
empty string |
syseventlog.tag
--log-timestamps=# | |
log_timestamps | |
UTC | |
|
mysql.general_log
CONVERT_TZ()
time_zone
log_timestamps
SYSTEM
YYYY-MM-DDThh:mm:ss.uuuuuu
±hh:mm
log_throttle_queries_not_using_indexes
log_throttle_queries_not_using_indexes | |
0 |
log_queries_not_using_indexes
log_throttle_queries_not_using_indexes
--log-warnings[=#] | |
log_warnings | |
2 | |
0 | |
18446744073709551615 | |
4294967295 |
log_error_verbosity
--long-query-time=# | |
long_query_time | |
10 | |
0 |
Slow_queries
long_query_time
--low-priority-updates | |
low_priority_updates | |
FALSE |
1
INSERT
UPDATE
DELETE
SELECT
MyISAM
MERGE
lower_case_file_system | |
OFF
--lower-case-table-names[=#] | |
lower_case_table_names | |
0 | |
0 | |
2 |
lower_case_table_names
tbl_name
tbl_name
--lower_case_table_names=0
InnoDB
lower_case_table_names
--mandatory-roles=value | |
mandatory_roles | |
empty string |
mandatory_roles
SET PERSIST mandatory_roles = '`role1`@`%`,`role2`,role3,role4@localhost';
mandatory_roles
ROLE_ADMIN
SYSTEM_VARIABLES_ADMIN
SUPER
user_name
@host_name
mandatory_roles
REVOKE
DROP ROLE
DROP USER
activate_all_roles_on_login
SET
ROLE
mandatory_roles
SHOW GRANTS
--max-allowed-packet=# | |
max_allowed_packet | |
67108864 | |
4194304 | |
1024 | |
1073741824 |
mysql_stmt_send_long_data()
net_buffer_length
max_allowed_packet
BLOB
BLOB
max_allowed_packet
max_allowed_packet
max_allowed_packet
max_allowed_packet
max_allowed_packet
--max-connect-errors=# | |
max_connect_errors | |
100 | |
1 | |
18446744073709551615 | |
4294967295 |
FLUSH HOSTS
max_connect_errors
--max-connections=# | |
max_connections | |
151 | |
1 | |
100000 |
max_connections
max_connections+1
CONNECTION_ADMIN
SUPER
SUPER
SHOW PROCESSLIST
max_connections
Connection_errors_max_connections
--max-delayed-threads=# | |
max_delayed_threads | |
20 | |
0 | |
16384 |
DELAYED
--max-digest-length=# | |
max_digest_length | |
1024 | |
0 | |
1048576 |
max_digest_length
max_digest_length
performance_schema_max_digest_length
performance_schema_max_digest_length
max_digest_length
--max-error-count=# | |
max_error_count | |
1024 | |
64 | |
0 | |
65535 |
SHOW
ERRORS
SHOW
WARNINGS
GET DIAGNOSTICS
--max-execution-time=# | |
max_execution_time | |
0 |
SELECT
max_execution_time
max_execution_time
MAX_EXECUTION_TIME(
N
)N
max_execution_time
SELECT
max_execution_time
SELECT
--max-heap-table-size=# | |
max_heap_table_size | |
16777216 | |
16384 | |
1844674407370954752 | |
4294967295 |
MEMORY
MAX_ROWS
CREATE TABLE
ALTER TABLE
TRUNCATE TABLE
max_heap_table_size
tmp_table_size
max_heap_table_size
max_insert_delayed_threads | |
max_delayed_threads
DELAYED
--max-join-size=# | |
max_join_size | |
18446744073709551615 | |
1 | |
18446744073709551615 |
max_join_size
max_join_size
DEFAULT
sql_big_selects
sql_big_selects
max_join_size
--max-length-for-sort-data=# | |
max_length_for_sort_data | |
4096 | |
1024 | |
4 | |
8388608 |
filesort
--max-points-in-geometry=integer | |
max_points_in_geometry | |
65536 | |
3 | |
1048576 |
points_per_circle
ST_Buffer_Strategy()
--max-prepared-stmt-count=# | |
max_prepared_stmt_count | |
16382 | |
0 | |
1048576 |
--max-seeks-for-key=# | |
max_seeks_for_key | |
18446744073709551615 | |
4294967295 | |
1 | |
18446744073709551615 | |
4294967295 |
--max-sort-length=# | |
max_sort_length | |
1024 | |
4 | |
8388608 |
max_sort_length
max_sort_length
ORDER
BY
max_sort_length
sort_buffer_size
--max-sp-recursion-depth[=#] | |
max_sp_recursion_depth | |
0 | |
255 |
max_sp_recursion_depth
thread_stack
--max-user-connections=# | |
max_user_connections | |
0 | |
0 | |
4294967295 |
MAX_USER_CONNECTIONS
max_user_connections
max_user_connections
CREATE USER
ALTER USER
--max-write-lock-count=# | |
max_write_lock_count | |
18446744073709551615 | |
4294967295 | |
1 | |
18446744073709551615 | |
4294967295 |
--mecab-rc-file | |
mecab_rc_file | |
mecab_rc_file
mecab_rc_file
mecabrc
metadata_locks_cache_size | |
1024 | |
1 | |
1048576 |
metadata_locks_hash_instances | |
8 | |
1 | |
1024 |
--min-examined-row-limit=# | |
min_examined_row_limit | |
0 | |
0 | |
18446744073709551615 | |
4294967295 |
--multi-range-count=# | |
multi_range_count | |
256 | |
1 | |
4294967295 |
--myisam-data-pointer-size=# | |
myisam_data_pointer_size | |
6 | |
2 | |
7 |
CREATE TABLE
MAX_ROWS
--myisam-max-sort-file-size=# | |
myisam_max_sort_file_size | |
9223372036854775807 | |
2147483648 |
MyISAM
REPAIR TABLE
ALTER TABLE
LOAD DATA
INFILE
MyISAM
--myisam-mmap-size=# | |
myisam_mmap_size | |
18446744073709551615 | |
4294967295 | |
7 | |
18446744073709551615 | |
4294967295 |
MyISAM
myisam_recover_options | |
--myisam-repair-threads=# | |
myisam_repair_threads | |
1 | |
1 | |
18446744073709551615 | |
4294967295 |
MyISAM
--myisam-sort-buffer-size=# | |
myisam_sort_buffer_size | |
8388608 | |
4096 | |
18446744073709551615 | |
4294967295 | |
18446744073709551615 | |
4294967295 |
MyISAM
REPAIR TABLE
CREATE INDEX
ALTER TABLE
--myisam-stats-method=name | |
myisam_stats_method | |
nulls_unequal | |
|
NULL
nulls_equal
nulls_ignored
NULL
nulls_unequal
NULL
NULL
--myisam-use-mmap | |
myisam_use_mmap | |
OFF |
MyISAM
mysql_native_password_proxy_users
--mysql-native-password-proxy-users=[={OFF|ON}] | |
mysql_native_password_proxy_users | |
OFF |
mysql_native_password
check_proxy_users
named_pipe | |
OFF |
--net-buffer-length=# | |
net_buffer_length | |
16384 | |
1024 | |
1048576 |
net_buffer_length
max_allowed_packet
net_buffer_length
net_buffer_length
--net-read-timeout=# | |
net_read_timeout | |
30 | |
1 |
net_read_timeout
net_write_timeout
slave_net_timeout
--net-retry-count=# | |
net_retry_count | |
10 | |
1 | |
18446744073709551615 | |
4294967295 |
--net-write-timeout=# | |
net_write_timeout | |
60 | |
1 |
net_read_timeout
OFF
--ngram-token-size | |
ngram_token_size | |
2 | |
1 | |
10 |
ngram_token_size
--offline-mode=val | |
offline_mode | |
OFF |
CONNECTION_ADMIN
SUPER
CONNECTION_ADMIN
SUPER
SYSTEM_VARIABLES_ADMIN
SUPER
offline_mode
ON
offline_mode
OFF
ER_SERVER_OFFLINE_MODE
old
old
ORDER
BY
--old-alter-table | |
old_alter_table | |
OFF |
ALTER
TABLE
ALTER TABLE
ALTER TABLE ... DROP PARTITION
old_alter_table=ON
ALTER TABLE ... DROP PARTITION
old_alter_table=ON
old_passwords | |
0 | |
|
--open-files-limit=# | |
open_files_limit | |
5000, with possible adjustment | |
0 | |
platform dependent |
open_files_limit
max_connections
table_open_cache
1)10 max_connections(table_open_cache×2)2)max_connections×53)如果positive4)限制操作系统,如果操作系统限制是无限的:open_files_limit值指定在启动时,如果没有5000
--optimizer-prune-level[=#] | |
optimizer_prune_level | |
1 |
--optimizer-search-depth[=#] | |
optimizer_search_depth | |
62 | |
0 | |
62 |
--optimizer-switch=value | |
optimizer_switch | |
| |
| |
|
optimizer_switch
off
mysql> SELECT @@optimizer_switch\G
*************************** 1. row ***************************
@@optimizer_switch: index_merge=on,index_merge_union=on,
index_merge_sort_union=on,
index_merge_intersection=on,
engine_condition_pushdown=on,
index_condition_pushdown=on,
mrr=on,mrr_cost_based=on,
block_nested_loop=on,batched_key_access=off,
materialization=on,semijoin=on,loosescan=on,
firstmatch=on,duplicateweedout=on,
subquery_materialization_cost_based=on,
use_index_extensions=on,
condition_fanout_filter=on,derived_merge=on,
use_invisible_indexes=off,skip_scan=on
optimizer_trace | |
optimizer_trace_features | |
optimizer_trace_limit | |
1 |
optimizer_trace_max_mem_size | |
1048576 | |
16384 |
optimizer_trace_offset | |
-1 |
performance_schema_
xxx
--parser-max-mem-size=N | |
parser_max_mem_size | |
18446744073709551615 | |
4294967295 | |
10000000 | |
18446744073709551615 | |
4294967295 |
--password-history=# | |
password_history | |
0 | |
0 | |
4294967295 |
PASSWORD HISTORY DEFAULT
PASSWORD HISTORY
CREATE USER
ALTER USER
--password-require-current[={OFF|ON}] | |
password_require_current | |
OFF |
PASSWORD REQUIRE CURRENT
DEFAULT
PASSWORD
REQUIRE
CREATE
USER
ALTER USER
--password-reuse-interval=# | |
password_reuse_interval | |
0 | |
0 | |
4294967295 |
PASSWORD REUSE INTERVAL
DEFAULT
PASSWORD REUSE INTERVAL
CREATE USER
ALTER USER
--persisted-globals-load[=ON|OFF] | |
persisted_globals_load | |
ON |
mysqld-auto.cnf
persisted_globals_load
mysqld-auto.cnf
SET
PERSIST
RESET PERSIST
--pid-file
--pid-file
--pid-file
host_name
host_name
--plugin-dir=dir_name | |
plugin_dir | |
BASEDIR/lib/plugin |
SELECT
... INTO DUMPFILE
plugin_dir
--secure-file-priv
SELECT
--port
--preload-buffer-size=# | |
preload_buffer_size | |
32768 | |
1024 | |
1073741824 |
OFF
SHOW PROFILE
SHOW PROFILES
profiling
protocol_version | |
proxy_user | |
NULL
pseudo_slave_mode | |
pseudo_thread_id | |
--query-alloc-block-size=# | |
query_alloc_block_size | |
8192 | |
1024 | |
4294967295 | |
1024 |
--query-cache-limit=# | |
query_cache_limit | |
1048576 | |
0 | |
18446744073709551615 | |
4294967295 |
--query-cache-min-res-unit=# | |
query_cache_min_res_unit | |
4096 | |
512 | |
18446744073709551615 | |
4294967295 |
--query-cache-size=# | |
query_cache_size | |
0 | |
1048576 | |
0 | |
1048576 | |
0 | |
18446744073709551615 | |
4294967295 |
--query-cache-type=# | |
query_cache_type | |
0 | |
|
--query-cache-wlock-invalidate | |
query_cache_wlock_invalidate | |
FALSE |
--query-prealloc-size=# | |
query_prealloc_size | |
8192 | |
8192 | |
18446744073709551615 | |
4294967295 | |
1024 |
query_prealloc_size
rand_seed1
rand_seed2
SHOW VARIABLES
RAND()
RAND()
rand_seed1
rand_seed2
RAND()
rand_seed1
--range-alloc-block-size=# | |
range_alloc_block_size | |
4096 | |
4096 | |
18446744073709547520 | |
4294967295 | |
1024 |
--range-optimizer-max-mem-size=N | |
range_optimizer_max_mem_size | |
8388608 | |
0 | |
18446744073709551615 |
rbr_exec_mode | |
STRICT | |
|
IDEMPOTENT
IDEMPOTENT
BINLOG
--idempotent
SET SESSION RBR_EXEC_MODE=IDEMPOTENT;
--read-buffer-size=# | |
read_buffer_size | |
131072 | |
8200 | |
2147479552 |
MyISAM
ORDER
BY
read_buffer_size
MEMORY
read_only
CONNECTION_ADMIN
SUPER
super_read_only
super_read_only
SUPER
super_read_only
read_only
read_only
super_read_only
read_only
read_only
ANALYZE TABLE
OPTIMIZE TABLE
TEMPORARY
mysql.general_log
UPDATE
TRUNCATE TABLE
read_only
read_only
super_read_only
LOCK
TABLES
read_only
read_only
read_only
FLUSH TABLES WITH READ
LOCK
--read-rnd-buffer-size=# | |
read_rnd_buffer_size | |
262144 | |
1 | |
2147483647 |
MyISAM
MyISAM
ORDER BY
--regexp-stack-limit=# | |
regexp_stack_limit | |
8000000 | |
0 | |
2147483647 |
REGEXP_LIKE()
--regexp-time-limit=# | |
regexp_time_limit | |
32 | |
0 | |
2147483647 |
REGEXP_LIKE()
--require-secure-transport[={OFF|ON}] | |
require_secure_transport | |
OFF |
ER_SECURE_TRANSPORT_REQUIRED
REQUIRE SSL
require_secure_transport
shared_memory
require_secure_transport
ER_NO_SECURE_TRANSPORTS_CONFIGURED
resultset_metadata | |
FULL | |
|
resultset_metadata
NONE
resultset_metadata
--schema-definition-cache=N | |
schema_definition_cache | |
256 | |
256 | |
524288 |
schema_definition_cache
0
--secure-auth | |
secure_auth | |
ON | |
ON |
--secure-file-priv=dir_name | |
secure_file_priv | |
platform specific | |
|
LOAD DATA
SELECT ... INTO
OUTFILE
LOAD_FILE()
FILE
secure_file_priv
NULL
INSTALL_LAYOUT
secure_file_priv
INSTALL_SECURE_FILE_PRIVDIR
INSTALL_LAYOUT | secure_file_priv |
---|---|
STANDALONE
| |
DEB
SLES
| /var/lib/mysql-files |
mysql-files CMAKE_INSTALL_PREFIX |
secure_file_priv
secure_file_priv
--server-id=# | |
server_id | |
1 | |
0 | |
0 | |
4294967295 |
--server-id
--server-id
--session-track-gtids=[value] | |
session_track_gtids | |
OFF | |
|
OFF
OWN_GTID
ALL_GTIDS
--session-track-schema=# | |
session_track_schema | |
ON |
--session-track-state-change=# | |
session_track_state_change | |
OFF |
session_track_state_change
session_track_system_variables
session_track_state_change
session_track_schema
session_track_system_variables
session_track_system_variables
--session-track-system-variables=# | |
session_track_system_variables | |
time_zone, autocommit, character_set_client, character_set_results, character_set_connection |
time_zone
autocommit
character_set_client
character_set_results
character_set_connection
SET NAMES
*
session_track_system_variables
session_track_transaction_info
--session-track-transaction-info=value | |
session_track_transaction_info | |
OFF | |
|
OFF
STATE
session_track_transaction_info
mysql_session_track_get_first()
CHARACTERISTICS
只读读writeisolation水平一致的快照
session_track_transaction_info
mysql_session_track_get_first()
SESSION_TRACK_TRANSACTION_CHARACTERISTICS
transaction_read_only
transaction_isolation
session_track_system_variables
sha256_password_auto_generate_rsa_keys
--sha256-password-auto-generate-rsa-keys[={OFF|ON}] | |
sha256_password_auto_generate_rsa_keys | |
ON |
sha256_password_auto_generate_rsa_keys
caching_sha2_password_auto_generate_rsa_keys
caching_sha2_password
auto_generate_certs
sha256_password_private_key_path
--sha256-password-private-key-path=file_name | |
sha256_password_private_key_path | |
private_key.pem |
sha256_password
sha256_password
--sha256-password-proxy-users=[={OFF|ON}] | |
sha256_password_proxy_users | |
OFF |
sha256_password
check_proxy_users
sha256_password_public_key_path
--sha256-password-public-key-path=file_name | |
sha256_password_public_key_path | |
public_key.pem |
sha256_password
sha256_password
--shared-memory[={0,1}] | |
shared_memory | |
FALSE |
--shared-memory-base-name=name | |
shared_memory_base_name | |
MYSQL |
MYSQL
--show-compatibility-56[={OFF|ON}] | |
show_compatibility_56 | |
OFF |
INFORMATION_SCHEMA
--show-create-table-verbosity | |
show_create_table_verbosity | |
SHOW CREATE TABLE
SHOW CREATE TABLE
--show-old-temporals={OFF|ON} | |
show_old_temporals | |
OFF |
SHOW CREATE TABLE
TIME
DATETIME
TIMESTAMP
SHOW
CREATE TABLE
CREATE TABLE `mytbl` ( `ts` timestamp /* 5.5 binary format */ NOT NULL DEFAULT CURRENT_TIMESTAMP, `dt` datetime /* 5.5 binary format */ DEFAULT NULL, `t` time /* 5.5 binary format */ DEFAULT NULL) DEFAULT CHARSET=utf8mb4
COLUMN_TYPE
INFORMATION_SCHEMA.COLUMNS
--skip-external-locking | |
skip_external_locking | |
ON |
OFF
ON
MyISAM
--external-locking
--skip-external-locking
MyISAM
--skip-name-resolve | |
skip_name_resolve | |
OFF |
--skip-name-resolve
ON
Host
--skip-networking | |
skip_networking | |
ON
--skip-networking
--skip-show-database | |
skip_show_database | |
SHOW
DATABASES
SHOW DATABASES
SHOW DATABASES
SHOW DATABASES
SHOW
DATABASES
SHOW DATABASES
SHOW
DATABASES
--slow-launch-time=# | |
slow_launch_time | |
2 |
Slow_launch_threads
--slow-query-log | |
slow_query_log | |
OFF |
OFF
--slow_query_log
log_output
long_query_time
--slow-query-log-file=file_name | |
slow_query_log_file | |
host_name-slow.log |
host_name
-slow.log
--socket={file_name|pipe_name} | |
socket | |
/tmp/mysql.sock | |
MySQL |
/tmp/mysql.sock
MySQL
--sort-buffer-size=# | |
sort_buffer_size | |
262144 | |
32768 | |
18446744073709551615 | |
4294967295 | |
4294967295 |
sort_buffer_size
sort_buffer_size
max_sort_length
sort_buffer_size
Sort_merge_passes
SHOW GLOBAL
STATUS
sort_buffer_size
GROUP
BY
sort_buffer_size
sql_auto_is_null | |
0 |
AUTO_INCREMENT
SELECT * FROM tbl_name
哪里 auto_col
是空的
LAST_INSERT_ID()
AUTO_INCREMENT
SELECT
AUTO_INCREMENT
IS NULL
sql_auto_is_null
sql_auto_is_null
sql_big_selects | |
1 |
SELECT
max_join_size
SELECT
max_join_size
sql_big_selects
sql_buffer_result | |
0 |
sql_buffer_result
SELECT
sql_log_off | |
0 |
SYSTEM_VARIABLES_ADMIN
SUPER
--sql-mode=name | |
sql_mode | |
ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_ENGINE_SUBSTITUTION | |
ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION | |
| |
| |
|
Note
Note
warning_count
SHOW CREATE TABLE
SHOW CREATE DATABASE
--sql-require-primary-key[={OFF|ON}] | |
sql_require_primary_key | |
OFF |
SYSTEM_VARIABLES_ADMIN
SUPER
sql_require_primary_key
sql_require_primary_key
CREATE TABLE ...
LIKE
CREATE
TABLE
ALTER TABLE
UNIQUE NOT NULL
UPDATE
DELETE
LIMIT
UPDATE
LIMIT
DELETE
UPDATE
DELETE
sql_select_limit | |
SELECT
DEFAULT
SELECT
LIMIT
sql_select_limit
INSERT
--ssl-capath=dir_name | |
ssl_capath | |
--ssl-cipher=name | |
ssl_cipher | |
--ssl-crlpath=dir_name | |
ssl_crlpath | |
--ssl-fips-mode={OFF|ON|STRICT} | |
ssl_fips_mode | |
OFF | |
|
ssl_fips_mode
xxx
ssl_fips_mode
OFF
ON
STRICT
ssl_fips_mode
ssl_fips_mode
STRICT
--stored-program-cache=# | |
stored_program_cache | |
256 | |
16 | |
524288 |
stored_program_definition_cache
--stored-program-definition-cache=N | |
stored_program_definition_cache | |
256 | |
256 | |
524288 |
stored_program_definition_cache
stored_program_cache
stored_program_cache
--super-read-only[={OFF|ON}] | |
super_read_only | |
OFF |
read_only
SUPER
super_read_only
SUPER
read_only
read_only
super_read_only
super_read_only
--syseventlog.facility=value | |
syseventlog.facility | |
daemon |
syslog
syslog
--syseventlog.include-pid[={0|1}] | |
syseventlog.include_pid | |
ON |
syslog
--syseventlog.tag=tag | |
syseventlog.tag | |
empty string |
syslog
mysqld
tag
tag
system_time_zone | |
system_time_zone
--timezone
system_time_zone
time_zone
table_definition_cache | |
-1 | |
400 | |
524288 |
MIN(400 + table_open_cache / 2, 2000)
InnoDB
table_definition_cache
table_definition_cache
table_definition_cache
table_definition_cache
InnoDB
innodb_open_files
table_definition_cache
innodb_open_files
table_definition_cache
table_definition_cache
innodb_open_files
table_open_cache | |
4000 | |
2000 | |
1 | |
524288 |
Opened_tables
Opened_tables
FLUSH
TABLES
table_open_cache
table_open_cache_instances | |
16 | |
1 | |
64 |
table_open_cache
table_open_cache_instances
--temptable-max-ram=# | |
temptable_max_ram | |
1073741824 | |
2097152 | |
2^64-1 |
TempTable
--thread-cache-size=# | |
thread_cache_size | |
-1 | |
0 | |
16384 |
thread_cache_size
thread_cache_size
Connections
Threads_created
8 + (max_connections / 100)
--thread-handling=name | |
thread_handling | |
one-thread-per-connection | |
|
no-threads
no-threads
--thread-pool-algorithm=# | |
thread_pool_algorithm | |
0 | |
0 | |
1 |
thread_pool_high_priority_connection
--thread-pool-high-priority-connection=# | |
thread_pool_high_priority_connection | |
0 | |
0 | |
1 |
thread_pool_max_unused_threads
--thread-pool-max-unused-threads=# | |
thread_pool_max_unused_threads | |
0 | |
0 | |
4096 |
N
N
N
--thread-pool-prio-kickup-timer=# | |
thread_pool_prio_kickup_timer | |
1000 | |
0 | |
4294967294 |
--thread-pool-size=# | |
thread_pool_size | |
16 | |
1 | |
64 |
--thread-pool-stall-limit=# | |
thread_pool_stall_limit | |
6 | |
4 | |
600 |
--thread-stack=# | |
thread_stack | |
262144 | |
196608 | |
131072 | |
18446744073709551615 | |
4294967295 | |
1024 |
'SYSTEM'
system_time_zone
--default-time-zone
SYSTEM
timestamp_value
UNIX_TIMESTAMP()
DEFAULT
timestamp
timestamp
timestamp
BIGINT
SET timestamp
NOW()
SYSDATE()
SYSDATE()
--sysdate-is-now
SYSDATE()
NOW()
--tls-version=protocol_list | |
tls_version | |
TLSv1,TLSv1.1,TLSv1.2 | |
|
--tmp-table-size=# | |
tmp_table_size | |
16777216 | |
1024 | |
18446744073709551615 |
MEMORY
tmp_table_size
max_heap_table_size
internal_tmp_disk_storage_engine
tmp_table_size
max_heap_table_size
Created_tmp_disk_tables
Created_tmp_tables
:
tmpdir
LOAD DATA
INFILE
slave_load_tmpdir
tmpdir
tmpdir
--transaction-alloc-block-size=# | |
transaction_alloc_block_size | |
8192 | |
1024 | |
131072 | |
1024 |
transaction_prealloc_size
--transaction-isolation=name | |
transaction_isolation | |
REPEATABLE-READ | |
|
REPEATABLE-READ
SET TRANSACTION
transaction_isolation
SET transaction_isolation = 'READ-COMMITTED';
--transaction-isolation
SET
集@ @ var_name
=value
集@ @会议 var_name
=value
;
transaction_isolation
SET @@transaction_isolation =
value
SET @@session.transaction_isolation =
value
SET
@@transaction_isolation
--transaction-prealloc-size=# | |
transaction_prealloc_size | |
4096 | |
1024 | |
131072 | |
1024 |
transaction_prealloc_size
transaction_alloc_block_size
transaction_prealloc_size
transaction_prealloc_size
--transaction-read-only | |
transaction_read_only | |
OFF |
OFF
SET TRANSACTION
--transaction-read-only
SET
集@ @ var_name
=value
集@ @会议 var_name
=value
;
transaction_read_only
SET @@transaction_read_only =
value
SET @@session.transaction_read_only =
value
SET
@@transaction_read_only
tx_isolation | |
REPEATABLE-READ | |
|
transaction_isolation
tx_read_only | |
OFF |
transaction_read_only
unique_checks | |
1 |
InnoDB
--updatable-views-with-limit=# | |
updatable_views_with_limit | |
1 |
LIMIT
UPDATE
DELETE
UNIQUE
1
0
use_secondary_engine | |
OFF | |
|
validate_password.
xxx
validate_password
xxx
validate_user_plugins | |
ON |
sha256_password
validate_user_plugins
-debug
version_comment | |
COMPILATION_COMMENT
version_compile_machine | |
version_compile_os | |
version_compile_zlib | |
zlib
--wait-timeout=# | |
wait_timeout | |
28800 | |
1 | |
31536000 | |
2147483 |
wait_timeout
wait_timeout
interactive_timeout
mysql_real_connect()
interactive_timeout
--windowing-use-high-precision=# | |
windowing_use_high_precision | |
ON |
SET
log_filter_dragnet
dragnet.log_error_filter_rules
sql_mode
sql_mode
K
G
InnoDB
mysqld --innodb_log_file_size=16M --max_allowed_packet=1G
[mysqld] innodb_log_file_size=16M max_allowed_packet=1G
16M
1G
SET
var_name
=value
innodb_log_file_size
--maximum-innodb_log_file_size=32M
SET
SET
GLOBAL
SET GLOBAL max_connections = 1000; SET @@global.max_connections = 1000;
SYSTEM_VARIABLES_ADMIN
SUPER
PERSIST
SET PERSIST max_connections = 1000; SET @@persist.max_connections = 1000;
SET
SET
GLOBAL
SET
PERSIST
SYSTEM_VARIABLES_ADMIN
SUPER
mysqld-auto.cnf
RESET PERSIST;
persisted_globals_load
mysqld-auto.cnf
SET
PERSIST
currently unknown variable 'var_name
'
was read from the persisted config file
PERSIST_ONLY
PERSIST
SET PERSIST_ONLY back_log = 1000;SET @@persist_only.back_log = 1000;
PERSIST
mysqld-auto.cnf
PERSIST_ONLY
PERSIST_RO_VARIABLES_ADMIN
mysqld-auto.cnf
{“版本”:1,“mysql_server”:{“max_connections”:{“价值”:“152”、“元数据”:{“时间戳”:1.519921356e 15,“用户”:“根”、“主机”:“localhost”} },“transaction_isolation”:{“价值”:“read-committed”、“元数据”:{“时间戳”:1.519921553e 15,“用户”:“根”、“主机”:“localhost”} },“mysql_server_static_options”:{“innodb_api_enable_mdl”:{“价值”:“0”、“元数据”:{“时间戳”:1.519921573e 15“用户”:“根”、“主机”:“localhost”} },“log_slave_updates”:{“价值”:“1”、“元数据”:{“时间戳”:1.519921582e 15,“用户”:“根”、“主机”:“localhost”} } } } }
PERSIST_ONLY
"mysql_server_static_options"
SET
GLOBAL
SESSION
@@
SET SESSION sql_mode = 'TRADITIONAL';SET @@session.sql_mode = 'TRADITIONAL';SET @@sql_mode = 'TRADITIONAL';
SYSTEM_VARIABLES_ADMIN
SUPER
sql_log_bin
mysqld-auto.cnf
LOCAL
SESSION
SET
SET
GLOBAL
SET
PERSIST
SET
PERSIST_ONLY
mysql> SET GLOBAL sql_log_bin = ON;
ERROR 1228 (HY000): Variable 'sql_log_bin' is a SESSION
variable and can't be used with SET GLOBAL
GLOBAL
PERSIST
PERSIST_ONLY
mysql> SET max_connections = 1000;
ERROR 1229 (HY000): Variable 'max_connections' is a
GLOBAL variable and should be set with SET GLOBAL
SET
PERSIST
SET
PERSIST_ONLY
mysql>SET PERSIST port = 3307;
ERROR 1238 (HY000): Variable 'port' is a read only variable mysql>SET PERSIST_ONLY port = 3307;
ERROR 1238 (HY000): Variable 'port' is a non persistent read only variable
SET
SESSION
mysql> SET SESSION max_connections = 1000;
ERROR 1229 (HY000): Variable 'max_connections' is a
GLOBAL variable and should be set with SET GLOBAL
SET
SET @x = 1, SESSION sql_mode = '';
GLOBAL
PERSIST_ONLY
SET GLOBAL sort_buffer_size = 1000000, SESSION sort_buffer_size = 1000000; SET @@global.sort_buffer_size = 1000000, @@local.sort_buffer_size = 1000000; SET GLOBAL max_connections = 1000, sort_buffer_size = 1000000;
SET
SET GLOBAL
SET
PERSIST
mysqld-auto.cnf
SET
GLOBAL
SET
PERSIST
persisted_variables
SELECT
variables_info
GLOBAL
GLOBAL
max_join_size
SET @@session.max_join_size=DEFAULT;SET @@session.max_join_size=@@global.max_join_size;
DEFAULT
SET
PERSIST
DEFAULT
RESET PERSIST
DEFAULT
@@
SELECT
选择“@global.sql_mode,@ @session.sql_mode,@ @ sql_mode;
@@
var_name
@@session.
var_name
=expr
SET
SET
内核> mysql --max_allowed_packet=16M
内核> mysql --max_allowed_packet=16*1024*1024
mysql>SET GLOBAL max_allowed_packet=16M;
mysql>SET GLOBAL max_allowed_packet=16*1024*1024;
SET
1
0
0
OFF
--delay_key_write=1
--delay_key_write=ON
SHOW VARIABLES
MySQL的> SHOW VARIABLES;
--------------------------------- _ name变量值| ----------------------------------- | | --------------------------------- ----------------------------------- | _增量增量1车车_ | | | _ _偏移增量| | |自动_ SP 1我们_ Privileges | | |背_日志| | | BASEDIR | 151 /家/ MySQL / | | binlog _ _ | 32768 | |缓存大小大容量插入缓冲区大小_ _ _ | 8388608 |字符集的客户| _ _ | UTF8字符集| | _ _ | UTF8字符连接数据库| | _集_ | utf8mb4 | |字符集的二进制文件系统_ _ | |字符集| _ _ results| utf8字符集| | _ _ Server | utf8mb4 | |字符集系统_ _ | UTF8字符集| | _ _ dir | /家/ MySQL /分享/ MySQL /零食/ | charsets | _连接词一般| UTF8 _ _ | |小吃_数据库| utf8mb4 _ _ _词有点| |小吃_ Server | utf8mb4 _ _ _词有点|……| InnoDB _ autoextend _增量| 8 | | InnoDB缓冲池大小_ _ _ | 8388608 | | InnoDB _ _并发提交| 0票| | InnoDB _并发_ | 500 | | InnoDB数据文件的路径| _ _ _ ibdata1:10M | InnoDB数据:autoextend | _ _ Home目录版本_ | |……| | 8.0.1-dmr-log | |版本_怎么|源分布我们| | _编译版本_机械| i686 | |编译版本_ SuSE Linux操作系统| _ | |等_超时| 28800 | --------------------------------- -----------------------------------
LIKE
LIKE
显示变量的max_join_size”;显示会话变量如max_join_size”;
%
LIKE
显示变量''%1大小%;显示全局变量是“大小%;
_
SHOW VARIABLES
SESSION
GLOBAL
SESSION
SYSTEM_VARIABLES_ADMIN
SUPER
SESSION
SESSION
GLOBAL
SET
PERSIST
SET
PERSIST_ONLY
auto_generate_certs basedir bind_address character_set_system character_sets_dir core_file datadir default_authentication_plugin ft_stopword_file have_statement_timeout have_symlink hostname init_file keyring_operations large_files_support large_page_size lc_messages_dir license locked_in_memory log_bin log_bin_basename log_bin_index log_bin_use_v1_row_events log_error lower_case_file_system named_pipe persisted_globals_load pid_file plugin_dir port protocol_version relay_log relay_log_basename relay_log_index relay_log_info_file secure_file_priv server_uuid shared_memory shared_memory_base_name skip_external_locking skip_networking slave_load_tmpdir socket ssl_ca ssl_capath ssl_cert ssl_crl ssl_crlpath ssl_key system_time_zone tmpdir version_comment version_compile_machine version_compile_os version_compile_zlib
audit_log_current_session audit_log_file audit_log_filter_id audit_log_format caching_sha2_password_auto_generate_rsa_keys caching_sha2_password_private_key_path caching_sha2_password_public_key_path daemon_memcached_engine_lib_name daemon_memcached_engine_lib_path daemon_memcached_option innodb_buffer_pool_load_at_startup innodb_data_file_path innodb_data_home_dir innodb_dedicated_server innodb_directories innodb_force_load_corrupted innodb_log_group_home_dir innodb_page_size innodb_read_only innodb_temp_data_file_path innodb_undo_directory innodb_undo_tablespaces innodb_version keyring_encrypted_file_data keyring_encrypted_file_password mecab_rc_file sha256_password_auto_generate_rsa_keys sha256_password_private_key_path sha256_password_public_key_path version_tokens_session
instance_name.component_name
hot_cache.key_buffer_sizehot_cache.key_cache_block_sizecold_cache.key_cache_block_size
default
default.key_buffer_size
key_buffer_size
default
hot-cache
global
local
var_name
shell> mysqld --hot_cache.key_buffer_size=64K
[mysqld] hot_cache.key_buffer_size=64K
hot_cache
shell>mysqld --key_buffer_size=256K \
--extra_cache.key_buffer_size=128K \
--extra_cache.key_cache_block_size=2048
--default.key_buffer_size=256K
shell>mysqld --key_buffer_size=6M \
--hot_cache.key_buffer_size=2M \
--cold_cache.key_buffer_size=2M
hot_cache
MySQL的> SET GLOBAL hot_cache.key_buffer_size = 10*1024*1024;
MySQL的> SET @@global.hot_cache.key_buffer_size = 10*1024*1024;
mysql> SELECT @@global.hot_cache.key_buffer_size;
LIKE
MySQL的> SHOW GLOBAL VARIABLES LIKE 'hot_cache.key_buffer_size';
SET
GLOBAL
SET
SESSION
SELECT
GLOBAL
SET
ON
ENUM
SHOW [GLOBAL | SESSION]
STATUS
GLOBAL
mysql> SHOW GLOBAL STATUS;
+-----------------------------------+------------+
| Variable_name | Value |
+-----------------------------------+------------+
| Aborted_clients | 0 |
| Aborted_connects | 0 |
| Bytes_received | 155372598 |
| Bytes_sent | 1176560426 |
...
| Connections | 30023 |
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 3 |
| Created_tmp_tables | 2 |
...
| Threads_created | 217 |
| Threads_running | 88 |
| Uptime | 1389872 |
+-----------------------------------+------------+
SUM(Com_xxx) = Questions + statements executed within stored programs = Queries
FLUSH STATUS
Connection_errors_
xxx
host_cache
binlog_cache_size
Binlog_stmt_cache_disk_use
binlog_stmt_cache_size
Caching_sha2_password_rsa_public_key
caching_sha2_password
caching_sha2_password_private_key_path
caching_sha2_password_public_key_path
Caching_sha2_password_rsa_public_key
Com_
xxx
xxx
Com_update
DELETE
UPDATE
Com_update_multi
DELETE
UPDATE
Com_stmt_
xxx
Com_stmt_
xxx
Com_stmt_prepare
Com_stmt_execute
Com_stmt_fetch
Com_stmt_send_long_data
Com_stmt_reset
Com_stmt_close
COM_
xxx
Com_stmt_prepare
Com_stmt_close
PREPARE
EXECUTE
DEALLOCATE PREPARE
Com_execute_sql
PREPARE
EXECUTE
DEALLOCATE PREPARE
Com_stmt_reprepare
Com_stmt_prepare
Com_explain_other
EXPLAIN FOR
CONNECTION
Com_change_repl_filter
CHANGE REPLICATION FILTER
accept()
Connection_errors_max_connections
max_connections
Connection_errors_peer_address
select()
libwrap
tmp_table_size
max_heap_table_size
Created_tmp_disk_tables
tmp_table_size
max_heap_table_size
Created_tmp_disk_tables
Created_tmp_tables
Created_tmp_disk_tables
Created_tmp_tables
SHOW
STATUS
Created_tmp_tables
DELAYED
DELAYED
DELAYED
dragnet.log_error_filter_rules
FLUSH TABLES
Com_flush
FLUSH
TABLES
FLUSH LOGS
group_replication_primary_member
group_replication_primary_member
COMMIT
external_lock()
SELECT col1 FROM
foo
ORDER BY
ORDER BY
... DESC
Innodb_available_undo_logs
Innodb_buffer_pool_dump_status
InnoDB
innodb_buffer_pool_dump_at_shutdown
Innodb_buffer_pool_load_status
InnoDB
innodb_buffer_pool_load_at_startup
innodb_buffer_pool_load_now
innodb_buffer_pool_load_abort
InnoDB
Innodb_buffer_pool_pages_data
InnoDB
Innodb_buffer_pool_pages_data
Innodb_buffer_pool_pages_total
Innodb_buffer_pool_bytes_dirty
InnoDB
Innodb_buffer_pool_pages_dirty
Innodb_buffer_pool_pages_latched
InnoDB
UNIV_DEBUG
InnoDB
Innodb_buffer_pool_pages_total
Innodb_buffer_pool_pages_free
Innodb_buffer_pool_pages_data
Innodb_buffer_pool_pages_misc
Innodb_buffer_pool_pages_total
InnoDB
Innodb_buffer_pool_pages_data
Innodb_buffer_pool_pages_total
Innodb_buffer_pool_read_ahead_rnd
InnoDB
Innodb_buffer_pool_read_requests
InnoDB
Innodb_buffer_pool_resize_status
InnoDB
innodb_buffer_pool_size
innodb_buffer_pool_size
InnoDB
InnoDB
InnoDB
innodb_buffer_pool_size
Innodb_buffer_pool_write_requests
InnoDB
fsync()
innodb_flush_method
fsync()
innodb_flush_method
InnoDB
InnoDB
InnoDB
fsync()
fsync()
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
InnoDB
Innodb_truncated_status_writes
SHOW ENGINE
INNODB STATUS
MyISAM
MyISAM
key_buffer_size
MyISAM
MyISAM
MyISAM
Key_reads
key_buffer_size
Key_reads
Key_read_requests
MyISAM
MyISAM
Last_query_cost
Last_query_cost
UNION
Last_query_cost
SELECT
SELECT
max_execution_time
SELECT
Max_used_connections
DELAYED
Ongoing_anonymous_transaction_count
Ongoing_anonymous_gtid_violating_transaction_count
gtid_next=ANONYMOUS
Ongoing_automatic_gtid_violating_transaction_count
gtid_next=AUTOMATIC
my_open()
Opened_tables
table_open_cache
Performance_schema_
xxx
max_prepared_stmt_count
Questions
COM_STATISTICS
Queries
COM_STATISTICS
COM_STMT_CLOSE
Rpl_semi_sync_master_net_avg_wait_time
0
Rpl_semi_sync_master_net_wait_time
0
Rpl_semi_sync_master_net_waits
ON
Rpl_semi_sync_master_timefunc_failures
gettimeofday()
Rpl_semi_sync_master_tx_avg_wait_time
Rpl_semi_sync_master_tx_wait_time
Rpl_semi_sync_master_wait_pos_backtraverse
Rpl_semi_sync_master_wait_sessions
ON
sha256_password
sha256_password_private_key_path
sha256_password_public_key_path
Rsa_public_key
sha256_password
Secondary_engine_execution_count
HEARTBEAT_INTERVAL
replication_connection_configuration
LAST_HEARTBEAT_TIMESTAMP
replication_connection_status
COUNT_RECEIVED_HEARTBEATS
replication_connection_status
COUNT_TRANSACTIONS_RETRIES
replication_applier_status
Slave_rows_last_search_algorithm_used
slave_rows_search_algorithms
SERVICE_STATE
replication_connection_status
replication_applier_status
slow_launch_time
long_query_time
sort_buffer_size
mysql> SHOW STATUS LIKE 'Ssl_server_not%';
+-----------------------+--------------------------+
| Variable_name | Value |
+-----------------------+--------------------------+
| Ssl_server_not_after | Apr 28 14:16:39 2025 GMT |
| Ssl_server_not_before | May 1 14:16:39 2015 GMT |
+-----------------------+--------------------------+
Ssl_used_session_cache_entries
openssl/ssl.h
#定义ssl_verify_none 0x00 #定义ssl_verify_peer 0x01 #定义ssl_verify_fail_if_no_peer_cert 0x02 #定义ssl_verify_client_once 0x04
SSL_VERIFY_PEER
table_open_cache
table_open_cache_instances
--tablespace-definition-cache=N | |
tablespace_definition_cache | |
256 | |
256 | |
524288 |
tablespace_definition_cache
0
Tc_log_max_pages_used
Tc_log_page_size
--log-tc-size
getpagesize()
Tc_log_max_pages_used
--log-tc-size
Threads_created
thread_cache_size
Threads_created
Connections
FLUSH
STATUS
sql_mode
InnoDB
innodb_strict_mode
ONLY_FULL_GROUP_BY
STRICT_TRANS_TABLES
NO_ZERO_IN_DATE
NO_ZERO_DATE
ERROR_FOR_DIVISION_BY_ZERO
NO_ENGINE_SUBSTITUTION
--sql-mode="
modes
"sql-mode="
modes
"my.ini
modes
--sql-mode=""
sql-mode=""
sql_mode
SET
SET GLOBAL sql_mode = 'modes
';SET SESSION sql_mode = 'modes
';
GLOBAL
SYSTEM_VARIABLES_ADMIN
SUPER
sql_mode
sql_mode
选择@ @ @ @session.sql_mode sql_mode;选择全球;
sql_mode
TRADITIONAL
INSERT
UPDATE
STRICT_TRANS_TABLES
STRICT_ALL_TABLES
DATE
DATETIME
TIMESTAMP
ALLOW_INVALID_DATES
'0000-00-00'
ALLOW_INVALID_DATES
"
`
ANSI_QUOTES
ERROR_FOR_DIVISION_BY_ZERO
MOD(
N
,0)INSERT
UPDATE
NULL
NULL
IGNORE
UPDATE IGNORE
SELECT
ERROR_FOR_DIVISION_BY_ZERO
ERROR_FOR_DIVISION_BY_ZERO
ERROR_FOR_DIVISION_BY_ZERO
ERROR_FOR_DIVISION_BY_ZERO
ERROR_FOR_DIVISION_BY_ZERO
NOT
NOT (a
BETWEEN b AND c)
HIGH_NOT_PRECEDENCE
MySQL的> SET sql_mode = '';
MySQL的> SELECT NOT 1 BETWEEN -5 AND 5;
-> 0mysql>SET sql_mode = 'HIGH_NOT_PRECEDENCE';
MySQL的> SELECT NOT 1 BETWEEN -5 AND 5;
> 1
(
COUNT()
mysql> CREATE TABLE count (i INT);
ERROR 1064 (42000): You have an error in your SQL syntax
mysql> CREATE TABLE `count` (i INT);
Query OK, 0 rows affected (0.00 sec)
IGNORE_SPACE
IGNORE_SPACE
IGNORE_SPACE
NO_AUTO_VALUE_ON_ZERO
NULL
NO_AUTO_VALUE_ON_ZERO
NULL
0
0
0
NO_AUTO_VALUE_ON_ZERO
NO_AUTO_VALUE_ON_ZERO
\
INDEX
DIRECTORY
CREATE
TABLE
ALTER
TABLE
NO_ENGINE_SUBSTITUTION
NO_ENGINE_SUBSTITUTION
CREATE TABLE
ALTER TABLE
NO_ENGINE_SUBSTITUTION
UNSIGNED
MySQL的> SET sql_mode = '';
查询行,0行受影响(0秒)MySQL > SELECT CAST(0 AS UNSIGNED) - 1;
错误1690(22003):bigint无符号值超出范围”(铸造(0为无符号)- 1)”
NO_UNSIGNED_SUBTRACTION
MySQL的> SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';
MySQL的> SELECT CAST(0 AS UNSIGNED) - 1;
------------------------- |铸造(0为无符号)-1 | ------------------------- | -1 | -------------------------
UNSIGNED
NO_UNSIGNED_SUBTRACTION
NO_UNSIGNED_SUBTRACTION
c2
c2
mysql>SET sql_mode='';
mysql>CREATE TABLE test (c1 BIGINT UNSIGNED NOT NULL);
mysql>CREATE TABLE t1 SELECT c1 - 1 AS c2 FROM test;
mysql>DESCRIBE t1;
+-------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------+------+-----+---------+-------+ | c2 | bigint(21) unsigned | NO | | 0 | | +-------+---------------------+------+-----+---------+-------+ mysql>SET sql_mode='NO_UNSIGNED_SUBTRACTION';
mysql>CREATE TABLE t2 SELECT c1 - 1 AS c2 FROM test;
mysql>DESCRIBE t2;
+-------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+------------+------+-----+---------+-------+ | c2 | bigint(21) | NO | | 0 | | +-------+------------+------+-----+---------+-------+
BIGINT UNSIGNED
NO_ZERO_DATE
'0000-00-00'
'0000-00-00'
'0000-00-00'
INSERT IGNORE
'0000-00-00'
NO_ZERO_DATE
NO_ZERO_DATE
NO_ZERO_DATE
NO_ZERO_DATE
NO_ZERO_IN_DATE
'2010-01-00'
'0000-00-00'
NO_ZERO_DATE
NO_ZERO_IN_DATE
'0000-00-00'
IGNORE
UPDATE IGNORE
NO_ZERO_IN_DATE
NO_ZERO_IN_DATE
NO_ZERO_IN_DATE
NO_ZERO_IN_DATE
HAVING
GROUP BY
HAVING
ONLY_FULL_GROUP_BY
CHAR
PAD_CHAR_TO_FULL_LENGTH
CHAR
VARCHAR
PAD_CHAR_TO_FULL_LENGTH
MySQL的> CREATE TABLE t1 (c1 CHAR(10));
查询行,0行受影响(0.37秒)MySQL > INSERT INTO t1 (c1) VALUES('xy');
查询行,1行的影响(0.01秒)MySQL > SET sql_mode = '';
查询行,0行受影响(0秒)MySQL > SELECT c1, CHAR_LENGTH(c1) FROM t1;
------ ----------------- | C1 | char_length(C1)| ------ ----------------- | XY | 2 | ------ ----------------- 1行集(0秒)MySQL > SET sql_mode = 'PAD_CHAR_TO_FULL_LENGTH';
查询行,0行受影响(0秒)MySQL > SELECT c1, CHAR_LENGTH(c1) FROM t1;
------------ ----------------- | C1 | char_length(C1)| ------------ ----------------- | XY | 10 | ------------ ----------------- 1行集(0秒)
TIME
DATE
TIMESTAMP
CREATE TABLE t (id INT, tval TIME(1));SET sql_mode='';INSERT INTO t (id, tval) VALUES(1, 1.55);SET sql_mode='TIME_TRUNCATE_FRACTIONAL';INSERT INTO t (id, tval) VALUES(2, 1.55);
mysql> SELECT id, tval FROM t ORDER BY id;
+------+------------+
| id | tval |
+------+------------+
| 1 | 00:00:01.6 |
| 2 | 00:00:01.5 |
+------+------------+
REAL_AS_FLOAT
PIPES_AS_CONCAT
ANSI_QUOTES
IGNORE_SPACE
ONLY_FULL_GROUP_BY
ANSI
S
S
outer_ref
SELECT * FROM T1,T1,在(选择最大(T1,T2,b)从…);
MAX(t1.b)
ANSI
S
outer_ref
S
const
TRADITIONAL
STRICT_TRANS_TABLES
STRICT_ALL_TABLES
NO_ZERO_IN_DATE
NO_ZERO_DATE
ERROR_FOR_DIVISION_BY_ZERO
NO_ENGINE_SUBSTITUTION
INSERT
UPDATE
DEFAULT
NULL
CREATE TABLE
INSERT IGNORE
UPDATE
IGNORE
SELECT
foreign_key_checks
STRICT_ALL_TABLES
STRICT_TRANS_TABLES
STRICT_ALL_TABLES
STRICT_TRANS_TABLES
STRICT_ALL_TABLES
STRICT_TRANS_TABLES
MOD(
N
,0)
NULL
IGNORE
UPDATE IGNORE
SELECT
'0000-00-00'
'0000-00-00'
'0000-00-00'
INSERT IGNORE
'0000-00-00'
'2010-00-01'
IGNORE
UPDATE
IGNORE
IGNORE
IGNORE
ERROR_FOR_DIVISION_BY_ZERO
NO_ZERO_DATE
NO_ZERO_IN_DATE
IGNORE
NULL
'abc'
IGNORE | ||
IGNORE | IGNORE | |
IGNORE | ||
IGNORE |
IGNORE
IGNORE
IGNORE
t
i
MySQL的> INSERT INTO t (i) VALUES(1),(1);
错误1062(23000):重复录入' 1 '关键'主'
IGNORE
MySQL的> INSERT IGNORE INTO t (i) VALUES(1),(1);
查询行,1行的影响,1报警(0.01秒)记录:2份:1警告:1mysql > SHOW WARNINGS;
--------- ------ --------------------------------------- |水平|代码|消息| --------- ------ --------------------------------------- |警告| 1062 |重复录入' 1 '关键'主' | --------- ------ --------------------------------------- 1行集(0秒)
IGNORE
CREATE TABLE
... SELECT
CREATE TABLE
SELECT
SELECT
DELETE
INSERT
UPDATE
IGNORE
ER_BAD_NULL_ERROR
ER_DUP_ENTRY
ER_DUP_ENTRY_WITH_KEY_NAME
ER_DUP_KEY
ER_NO_PARTITION_FOR_GIVEN_VALUE
ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT
ER_NO_REFERENCED_ROW_2
ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET
ER_ROW_IS_REFERENCED_2
ER_SUBQUERY_NO_1_ROW
ER_VIEW_CHECK_FAILED
sql_mode
'abc'
MySQL的> SET sql_mode = '';
查询行,0行受影响(0秒)MySQL > INSERT INTO t (i) VALUES('abc');
查询行,1行的影响,1报警(0.01秒)MySQL > SHOW WARNINGS;
--------- ------ -------------------------------------------------------- |水平|代码|消息| --------- ------ -------------------------------------------------------- |警告| 1366 |错误值:ABC柱'我'在连续1 | --------- ------ -------------------------------------------------------- 1行集(0秒)
mysql>SET sql_mode = 'STRICT_ALL_TABLES';
Query OK, 0 rows affected (0.00 sec) mysql>INSERT INTO t (i) VALUES('abc');
ERROR 1366 (HY000): Incorrect integer value: 'abc' for column 'i' at row 1
sql_mode
NOT
NULL
ER_BAD_NULL_ERROR
ER_CUT_VALUE_GROUP_CONCAT
ER_DATA_TOO_LONG
ER_DATETIME_FUNCTION_OVERFLOW
ER_DIVISION_BY_ZERO
ER_INVALID_ARGUMENT_FOR_LOGARITHM
ER_NO_DEFAULT_FOR_FIELD
ER_NO_DEFAULT_FOR_VIEW_FIELD
ER_TOO_LONG_KEY
ER_TRUNCATED_WRONG_VALUE
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
ER_WARN_DATA_OUT_OF_RANGE
ER_WARN_NULL_TO_NOTNULL
ER_WARN_TOO_FEW_RECORDS
ER_WRONG_ARGUMENTS
ER_WRONG_VALUE_FOR_TYPE
WARN_DATA_TRUNCATED
shell> mysql -h ::1
--bind-address
CREATE USER
GRANT
REVOKE
MySQL的> CREATE USER 'bill'@'::1' IDENTIFIED BY 'secret';
MySQL的> GRANT SELECT ON mydb.* TO 'bill'@'::1';
INET6_ATON()
INET6_NTOA()
INET_ATON()
INET_NTOA()
shell> ping6 ::1
16 bytes from ::1, icmp_seq=0 hlim=64 time=0.171 ms
16 bytes from ::1, icmp_seq=1 hlim=64 time=0.077 ms
...
--bind-address=
addr
addr
--bind-address
::1
--bind-address
[mysqld]bind-address = *
::1
--bind-address
::1
MySQL的> CREATE USER 'ipv6user'@'::1' IDENTIFIED BY 'ipv6pass';
CREATE USER
GRANT
shell> mysql -h ::1 -u ipv6user -pipv6pass
mysql>STATUS
... Connection: ::1 via TCP/IP ... mysql>SELECT CURRENT_USER(), @@bind_address;
+----------------+----------------+ | CURRENT_USER() | @@bind_address | +----------------+----------------+ | ipv6user@::1 | :: | +----------------+----------------+
Server host: 2001:db8:0:f101::1 Client host: 2001:db8:0:f101::2
--bind-address
[mysqld]bind-address = *
2001:db8:0:f101::1
--bind-address
2001:db8:0:f101::1
mysql> CREATE USER 'remoteipv6user'@'2001:db8:0:f101::2' IDENTIFIED BY 'remoteipv6pass';
2001:db8:0:f101::2
shell> mysql -h 2001:db8:0:f101::1 -u remoteipv6user -premoteipv6pass
mysql>STATUS
... Connection: 2001:db8:0:f101::1 via TCP/IP ... mysql>SELECT CURRENT_USER(), @@bind_address;
+-----------------------------------+----------------+ | CURRENT_USER() | @@bind_address | +-----------------------------------+----------------+ | remoteipv6user@2001:db8:0:f101::2 | :: | +-----------------------------------+----------------+
--bind-address
[mysqld]bind-address = *
--bind-address
http://gogonet.gogo6.com
http://gogonet.gogo6.com/page/freenet6-registration
root
shell> emerge gogoc
/etc/gogoc/gogoc.conf
password
userid=gogouserpasswd=gogopass
shell> /etc/init.d/gogoc start
shell> rc-update add gogoc default
shell> ping6 ipv6.google.com
shell> ifconfig tun
system_time_zone
--timezone=
timezone_name
TZ
--timezone
time_zone
time_zone
SYSTEM
--default-time-zone=
timezone
default-time-zone='timezone
'
SYSTEM_VARIABLES_ADMIN
SUPER
MySQL的> SET GLOBAL time_zone =
timezone
;
time_zone
time_zone
MySQL的> SET time_zone =
timezone
;
NOW()
CURTIME()
TIMESTAMP
TIMESTAMP
UTC_TIMESTAMP()
DATE
TIME
DATETIME
DATE
TIME
DATETIME
mysql> SELECT @@global.time_zone, @@session.time_zone;
timezone
'SYSTEM'
'+10:00'
'Europe/Helsinki'
'MET'
mysql
/usr/share/zoneinfo
shell> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
tz_file
tz_name
shell> mysql_tzinfo_to_sql tz_file
tz_name
| mysql -u root mysql
tz_file
内核> mysql_tzinfo_to_sql --leap
tz_file
| mysql -u root mysql
http://dev.mysql.com/downloads/timezones.html
shell> mysql -u root mysql < file_name
MyISAM
MyISAM
SYSTEM
/etc/localtime
mysql
mysql> SELECT COUNT(*) FROM mysql.time_zone_name;
+----------+
| COUNT(*) |
+----------+
| 0 |
+----------+
SELECT CONVERT_TZ('2007-03-11 2:00:00','US/Eastern','US/Central'); SELECT CONVERT_TZ('2007-03-11 3:00:00','US/Eastern','US/Central');
mysql>SELECT CONVERT_TZ('2007-03-11 2:00:00','US/Eastern','US/Central');
+------------------------------------------------------------+ | CONVERT_TZ('2007-03-11 2:00:00','US/Eastern','US/Central') | +------------------------------------------------------------+ | 2007-03-11 01:00:00 | +------------------------------------------------------------+ mysql>SELECT CONVERT_TZ('2007-03-11 3:00:00','US/Eastern','US/Central');
+------------------------------------------------------------+ | CONVERT_TZ('2007-03-11 3:00:00','US/Eastern','US/Central') | +------------------------------------------------------------+ | 2007-03-11 02:00:00 | +------------------------------------------------------------+
mysql>SELECT CONVERT_TZ('2007-03-11 2:00:00','US/Eastern','US/Central');
+------------------------------------------------------------+ | CONVERT_TZ('2007-03-11 2:00:00','US/Eastern','US/Central') | +------------------------------------------------------------+ | 2007-03-11 01:00:00 | +------------------------------------------------------------+ mysql>SELECT CONVERT_TZ('2007-03-11 3:00:00','US/Eastern','US/Central');
+------------------------------------------------------------+ | CONVERT_TZ('2007-03-11 3:00:00','US/Eastern','US/Central') | +------------------------------------------------------------+ | 2007-03-11 01:00:00 | +------------------------------------------------------------+
:59:59
NOW()
:59:61
TIMESTAMP
mysql>CREATE TABLE t1 (
a INT,
ts TIMESTAMP DEFAULT NOW(),
PRIMARY KEY (ts)
);
Query OK, 0 rows affected (0.01 sec) mysql>-- change to UTC
mysql>SET time_zone = '+00:00';
Query OK, 0 rows affected (0.00 sec) mysql>-- Simulate NOW() = '2008-12-31 23:59:59'
mysql>SET timestamp = 1230767999;
Query OK, 0 rows affected (0.00 sec) mysql>INSERT INTO t1 (a) VALUES (1);
Query OK, 1 row affected (0.00 sec) mysql>-- Simulate NOW() = '2008-12-31 23:59:60'
mysql>SET timestamp = 1230768000;
Query OK, 0 rows affected (0.00 sec) mysql>INSERT INTO t1 (a) VALUES (2);
Query OK, 1 row affected (0.00 sec) mysql>-- values differ internally but display the same
mysql>SELECT a, ts, UNIX_TIMESTAMP(ts) FROM t1;
+------+---------------------+--------------------+ | a | ts | UNIX_TIMESTAMP(ts) | +------+---------------------+--------------------+ | 1 | 2008-12-31 23:59:59 | 1230767999 | | 2 | 2008-12-31 23:59:59 | 1230768000 | +------+---------------------+--------------------+ 2 rows in set (0.00 sec) mysql>-- only the non-leap value matches
mysql>SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:59';
+------+---------------------+ | a | ts | +------+---------------------+ | 1 | 2008-12-31 23:59:59 | +------+---------------------+ 1 row in set (0.00 sec) mysql>-- the leap value with seconds=60 is invalid
mysql>SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';
Empty set, 2 warnings (0.00 sec)
mysql>-- selecting using UNIX_TIMESTAMP value return leap value
mysql>SELECT * FROM t1 WHERE UNIX_TIMESTAMP(ts) = 1230768000;
+------+---------------------+ | a | ts | +------+---------------------+ | 2 | 2008-12-31 23:59:59 | +------+---------------------+ 1 row in set (0.00 sec)
HELP
mysql
fill_help_tables.sql
fill_help_tables.sql
share/mysql
shell> mysql -u root mysql < fill_help_tables.sql
fill_help_tables.sql
fill_help_tables.sql
SIGTERM
SIGHUP
FLUSH
状态信息:当前目录:/无功/数据库/数据/运行的线程的堆栈大小:0:196608current锁:关键的缓存:defaultbuffer_size:8388600block_size:1024division_limit:100age_limit:300blocks使用:0not冲洗:0w_requests:0writes:0r_requests:0reads:0handler状态:read_key:0read_next:0read_rnd 0read_first:1write:0delete 0update:0table状态:打开表:5open表:0open文件:7open流:0alarm状态:主动报警:1max用报警:2next报警时间:67
SHUTDOWN
SIGTERM
SIGTERM
错误:无法创建线程杀死服务器
REPAIR TABLE
OPTIMIZE TABLE
UPDATE
INSERT
KILL QUERY
KILL
CONNECTION
--relay-log-recovery
InnoDB
innodb_fast_shutdown
0 = successful termination (no restart done)
1 = unsuccessful termination (no restart done)
2 = unsuccessful termination (restart done)
mysql
performance_schema
sys
INFORMATION_SCHEMA
InnoDB
mysqld-auto.cnf
--datadir
mysql
InnoDB
mysql
mysql.ibd
catalogs
character_sets
collations
column_statistics
column_type_elements
columns
dd_properties
events
--skip-grant-tables
foreign_keys
index_column_usage
index_partitions
index_stats
ANALYZE
TABLE
indexes
innodb_ddl_log
parameter_type_elements
parameters
resource_groups
routines
schemata
st_spatial_reference_systems
table_partition_values
table_partitions
table_stats
ANALYZE
TABLE
tables
tablespace_files
tablespaces
triggers
view_routine_usage
view_table_usage
SELECT
SHOW TABLES
INFORMATION_SCHEMA
mysql.schemata
MySQL的> SELECT * FROM mysql.schemata;
错误3554(hy000):访问数据字典表的MySQL。图式”被拒绝。
INFORMATION_SCHEMA
MySQL的> SELECT * FROM INFORMATION_SCHEMA.SCHEMATA\G
*************************** 1。行*************************** catalog_name:def schema_name:mysqldefault_character_set_name:utf8mb4 default_collation_name:utf8mb4_0900_ai_ci sql_path:空*************************** 2。行*************************** catalog_name:def schema_name:information_schemadefault_character_set_name:UTF8 default_collation_name:utf8_general_ci sql_path:空…
INFORMATION_SCHEMA
INFORMATION_SCHEMA.STATISTICS
INFORMATION_SCHEMA
mysql.foreign_key_column_usage
REFERENTIAL_CONSTRAINTS
KEY_COLUMN_USAGE
foreign_key_column_usage
mysql
events
parameters
proc
InnoDB
CREATE USER
GRANT
MyISAM
user
global_grants
db
tables_priv
columns_priv
procs_priv
proxies_priv
default_roles
SET ROLE
DEFAULT
role_edges
user
password_history
component
func
--skip-grant-tables
plugin
--skip-grant-tables
gtid_executed
ndb_binlog_index
ndb_binlog_index
NDB
slave_master_info
slave_worker_info
innodb_index_stats
InnoDB
server_cost
server_cost
audit_log_filter
firewall_users
servers
innodb_dynamic_metadata
InnoDB
long_query_time | |
FLUSH LOGS
flush-logs
--flush-logs
--master-data
max_binlog_size
general_log
mysql
--log-output
--log-output[=
value
,...]
--log-output
FILE
NONE
--log-output
general_log
general_log
general_log_file
slow_query_log
slow_query_log_file
--log-output=TABLE,FILE
--general_log
--log-output=TABLE
--general_log
--slow_query_log
--log-output=FILE
--slow_query_log
--log-output
log_output
general_log
slow_query_log
OFF
general_log_file
slow_query_log_file
sql_log_off
OFF
SHOW CREATE TABLE mysql.general_log; SHOW CREATE TABLE mysql.slow_log;
CREATE TABLE
ALTER TABLE
DROP TABLE
ALTER TABLE
DROP TABLE
CSV
MyISAM
ALTER TABLE
MyISAM
slow_log
slow_query_log
SET @old_log_state = @@global.general_log;SET GLOBAL general_log = 'OFF';ALTER TABLE mysql.general_log ENGINE = MyISAM;SET GLOBAL general_log = @old_log_state;
TRUNCATE TABLE
RENAME TABLE
使用MySQL;如果表滴存在general_log2;创建表general_log2像general_log;重命名表general_log到general_log_backup,general_log2到general_log;
CHECK TABLE
LOCK TABLES
FLUSH TABLES WITH READ LOCK
read_only
FLUSH TABLES
FLUSH LOGS
mysqld
restarted
log_error_services
log_error_services
MySQL的> SELECT @@global.log_error_services;
---------------------------------------- | @ @global.log_error_services | ---------------------------------------- | log_filter_internal;log_sink_internal | ----------------------------------------
log_filter_internal
log_error_services
log_error_services
log_error_services
log_filter_internal
--log-error
--pid-file
--console
log_error_verbosity
log_error_services
INSTALL COMPONENT
log_error_services
log_error_services
INSTALL COMPONENT
log_error_services
log_error_services
log_error_services
UNINSTALL
COMPONENT
UNINSTALL
COMPONENT
log_error_services
log_sink_syseventlog
log_error_services
INSTALL COMPONENT 'file://component_log_sink_syseventlog';SET GLOBAL log_error_services = 'log_filter_internal; log_sink_syseventlog';
INSTALL COMPONENT
log_sink_syseventlog
log_error_services
SET GLOBAL log_error_services = 'log_filter_internal; log_sink_internal; log_sink_syseventlog';
SET GLOBAL log_error_services = 'log_filter_internal; log_sink_internal; UNINSTALL COMPONENT 'file://component_log_sink_syseventlog';
INSTALL COMPONENT
log_error_services
SET
PERSIST
my.cnf
SET
PERSIST
log_sink_json
log_sink_internal
安装的组件的组件_日志文件_ _ JSON库”;
log_error_services
[mysqld] log_error_services='log_filter_internal; log_sink_internal; log_sink_json'
SET
PERSIST
SET PERSIST log_error_services = 'log_filter_internal; log_sink_internal; log_sink_json';
log_error_services
log_error_services
_ _内燃机过滤日志;日志_沉_ 1;2 _沉_日志
log_error_services
_沉_ 1日志;日志过滤器内部_ _;日志_沉_ 2
stderr
log_error
--log-error
--pid-file
--console
--console
--console
--log-error
--log-error
--log-error
host_name
--pid-file
--log-error
log_error
log_error
--log-error
--log-error
--log-error
host_name
--log-error
--log-error
[server]
/var/log
log-error=/var/log/mysqld.log
host_name
.err
log_error
log_error
log_error
log_error
log_error
log_error
log_sink_internal
log_sink_test
log_sink_syseventlog
log_error
log_error
log_error
log_error
file_name
log_sink_internal
file_name
log_sink_json
log_error_services
file_name
NN
file_name
file_name
log_sink_syseventlog
log_error
syslog
log_filter_internal
log_error_services
INSTALL COMPONENT 'file://component_log_sink_syseventlog';SET GLOBAL log_error_services = 'log_filter_internal; log_sink_syseventlog';
log_error_services
Error
Note
MySQL
syslog
syseventlog.facility
daemon
syseventlog.include_pid
syseventlog.tag
syslog
log_syslog_facility
log_syslog_include_pid
log_syslog_tag
xxx
syslog
log_error_verbosity
syslog
log_filter_internal
log_error_services
INSTALL COMPONENT 'file://component_log_sink_json';SET GLOBAL log_error_services = 'log_filter_internal; log_sink_json';
log_error_services
log_sink_json
log_error_services
log_error_services
SET GLOBAL log_error_services = 'log_sink_json; log_filter_internal; log_sink_json';
log_error
log_error
NN
NN
log_error
file_name
log_error_services
file_name
file_name
log_error
log_json_writer
log_error_services
log_filter_internal
log_error_verbosity
log_filter_dragnet
dragnet.log_error_filter_rules
log_filter_internal
log_error_verbosity
log_error_verbosity
log_error_verbosity
log_error_verbosity
log_error_verbosity
log_error_verbosity
log_error_verbosity
log_filter_dragnet
dragnet.log_error_filter_rules
log_filter_dragnet
log_error_services
INSTALL COMPONENT 'file://component_log_filter_dragnet'; SET GLOBAL log_error_services = 'log_filter_dragnet; log_sink_internal';
log_error_services
log_filter_dragnet
dragnet.log_error_filter_rules
.
source_line
SET GLOBAL dragnet.log_error_filter_rules = 'IF prio>=INFORMATION THEN drop. IF EXISTS source_line THEN unset source_line.';
log_sink_internal
log_error_verbosity=2
SET GLOBAL dragnet.log_error_filter_rules = 'IF prio>=INFORMATION THEN throttle 1/60.';
dragnet.log_error_filter_rules
SET
PERSIST
SET
GLOBAL
SET GLOBAL log_error_services = 'log_filter_internal; log_sink_internal';
SET
PERSIST
SET
GLOBAL
log_filter_dragnet
卸载组件的文件:/ / component_log_filter_dragnet”;
log_filter_dragnet
log_filter_dragnet
.
rule
:如果 condition
然后 action
[ ElseIf condition
然后 action
]…[其他 action
] condition
:{ field
comparator
value
| [不]的存在 field
| condition
{或} | condition
} action
:{降|节流{ count
| count
/ window_size
} |集 field
[:= | =]value
|撤消[ field
] } field
:{ core_field
| optional_field
| user_defined_field
} core_field
开放时间:{ |味精| |标签错误代码错误| _ | _符号| SQL _ } |子系统状态 optional_field
:{ os_errno | os_errmsg |用户|主机|螺纹| query_id | source_file | source_line |功能} user_defined_field
: sequence of characters in [a-zA-Z0-9_] class
comparator
: {== | != | <> | >= | => | <= | =< | < | >}value
:{ string_literal
| integer_literal
| float_literal
| error_symbol
| severity
} count
: integer_literal
window_size
: integer_literal
string_literal
: sequence of characters quoted as '...' or "..."
integer_literal
: sequence of characters in [0-9] class
float_literal
: integer_literal
【 integer_literal
] error_symbol
: valid MySQL error symbol such as ER_ACCESS_DENIED_ERROR or ER_STARTUP
severity
:{误差|警告|信息}
AND
\
log_filter_dragnet
ERROR
INFORMATION
IF prio == INFORMATION THEN ... IF prio == 3 THEN ...
ER_STARTUP
err_code
IF err_code == ER_STARTUP THEN ...IF err_code == 1408 THEN ...
log_filter_dragnet
log_filter_dragnet
drop
throttle
count
count
window_size
count
window_size
IF err_code == ER_PLUGIN_SHUTTING_DOWN_PLUGIN THEN throttle 5.
IF prio <= INFORMATION THEN throttle 1000/3600 ELSE throttle 100/3600.
set
unset
unset
IF myfield == 2 THEN unset myfield. IF myfield == 2 THEN unset.
log_filter_dragnet
set
time
msg
prio
syslog
prio
IF prio == INFORMATION THEN ...IF prio == 3 THEN ...
ERROR | ||
WARNING | ||
INFORMATION |
WARNING
如果事先警告然后滴>。
log_filter_dragnet
log_error_verbosity
log_error_verbosity=1
如果事先>错误然后下降。
log_error_verbosity=2
如果事先警告然后滴>。
log_error_verbosity=3
如果事先>信息然后下降。
prio
err_code
err_code
IF err_code == ER_ACCESS_DENIED_ERROR THEN ...IF err_code == 1045 THEN ...
err_symbol
'ER_DUP_KEY'
log_filter_dragnet
SQL_state
'23000'
subsystem
InnoDB
Repl
OS_errno
OS_errmsg
label
prio
log_filter_dragnet
user
host
thread
query_id
source_file
sql/gis/distance.cc
IF source_file == "distance.cc" THEN ...
source_line
function
component
timestamp
thread_id
[severity
] [err_code
] [subsystem
]message
[
[
err_code
]subsystem
err_code
err_code
2018-03-22T12:35:47.538083Z 0 [Note] [MY-012487] [InnoDB] InnoDB: DDL log recovery : begin 2018-03-22T12:35:47.550565Z 0 [Warning] [MY-010068] [Server] CA certificate /var/mysql/sslinfo/cacert.pem is self signed. 2018-03-22T12:35:47.669397Z 4 [Note] [MY-010051] [Server] Event Scheduler: scheduler thread started with id 4 2018-03-22T12:35:47.550939Z 0 [Note] [MY-010253] [Server] IPv6 is available.
{ "prio": 3, "err_code": 10051, "subsystem": "Server", "source_file": "event_scheduler.cc", "function": "run", "msg": "Event Scheduler: scheduler thread started with id 4", "time": "2018-03-22T12:35:47.669397Z", "thread": 4, "err_symbol": "ER_SCHEDULER_STARTED", "SQL_state": "HY000", "label": "Note" }
log_timestamps
SYSTEM
FLUSH
ERROR LOGS
FLUSH LOGS
host_name
.err
MV host_name
错误 host_name
错误logsmv oldmysqladmin冲洗。 host_name
.err老 backup-directory
/var/log/mysqld.log
root
using
connection_type
connection_type
SSL/TLS
Named Pipe
binlog_format
MIXED
--general_log[={0|1}]
--general_log
--general_log_file=
file_name
--log-output
host_name
.log
general_log
general_log_file
general_log
ON
general_log_file
--log-output
log_output
NONE
shell>mv
shell>host_name
.loghost_name
-old.logmysqladmin flush-logs
shell>mv
host_name
-old.logbackup-directory
SET GLOBAL general_log = 'OFF';
SET GLOBAL general_log = 'ON';
sql_log_off
OFF
--log-raw
--log-raw
log_timestamps
CONVERT_TZ()
time_zone
DELETE
SELECT
SHOW
log_bin
--initialize
--initialize-insecure
--log-bin
--skip-log-bin
--disable-log-bin
--log-bin
--log-slave-updates
--slave-preserve-commit-order
--skip-log-slave-updates
--skip-slave-preserve-commit-order
--skip-log-bin
--disable-log-bin
--log-slave-updates
--slave-preserve-commit-order
--skip-log-bin
--disable-log-bin
--log-bin[=
base_name
]binlog
host_name
-bin--log-bin=
base_name.extension
max_binlog_size
max_binlog_size
'.index'
--log-bin-index[=
file_name
]
--log-bin
--log-bin
log_bin_basename
server_id
--server-id
SYSTEM_VARIABLES_ADMIN
SUPER
SET sql_log_bin=0
binlog_checksum
master_verify_checksum
slave_sql_verify_checksum
--binlog-do-db
--binlog-ignore-db
--replicate-do-db
--replicate-ignore-db
--log-slave-updates
RESET MASTER
PURGE BINARY LOGS
PURGE BINARY
LOGS
shell> mysqlbinlog log_file
| mysql -h server_name
UPDATE
DELETE
INSERT
COMMIT
COMMIT
ROLLBACK
binlog_cache_size
Binlog_cache_use
Binlog_cache_disk_use
binlog_cache_size
max_binlog_cache_size
CREATE ...
SELECT
INSERT ...
SELECT
MyISAM
sync_binlog=1
sync_binlog
sync_binlog
N
sync_binlog
sync_binlog
COMMIT
InnoDB
InnoDB
InnoDB
InnoDB
sync_binlog=1
sync_binlog=1
xid
InnoDB
InnoDB
sync_binlog=1
The
binary log
file_name
is shorter than
its expected size
--binlog-format=STATEMENT
--binlog-format=ROW
--binlog-format=MIXED
--binlog-format=
type
type
STATEMENT
ROW
MIXED
binlog_format
MySQL的> SET GLOBAL binlog_format = 'STATEMENT';
MySQL的> SET GLOBAL binlog_format = 'ROW';
MySQL的> SET GLOBAL binlog_format = 'MIXED';
binlog_format
MySQL的> SET SESSION binlog_format = 'STATEMENT';
MySQL的> SET SESSION binlog_format = 'ROW';
MySQL的> SET SESSION binlog_format = 'MIXED';
binlog_format
binlog_format
ROW
binlog_format
SYSTEM_VARIABLES_ADMIN
SUPER
WHERE
CREATE TEMPORARY
TABLE
InnoDB
READ
COMMITTED
READ
UNCOMMITTED
STATEMENT
ROW
CREATE TABLE
ALTER TABLE
DROP TABLE
--binlog-row-event-max-size
MIXED
UUID()
AUTO_INCREMENT
binlog_format = STATEMENT
UUID()
FOUND_ROWS()
ROW_COUNT()
USER()
CURRENT_USER()
CURRENT_USER
mysql
LOAD_FILE()
sql_mode
SHOW WARNINGS
SHOW WARNINGS
ARCHIVE | ||
BLACKHOLE | ||
CSV | ||
EXAMPLE | ||
FEDERATED | ||
HEAP | ||
InnoDB | REPEATABLE READ SERIALIZABLE | |
MyISAM | ||
MERGE | ||
NDB |
STATEMENT
MIXED
binlog_format | |||||
---|---|---|---|---|---|
* | - | ||||
STATEMENT | STATEMENT | ||||
MIXED | STATEMENT | ||||
ROW | BINLOG_FORMAT = ROW | - | |||
STATEMENT | BINLOG_FORMAT =
STATEMENT | STATEMENT | |||
MIXED | BINLOG_FORMAT = MIXED | - | |||
ROW | BINLOG_FORMAT = ROW | ||||
STATEMENT | |||||
MIXED | |||||
ROW | |||||
STATEMENT | BINLOG_FORMAT =
STATEMENT | - | |||
MIXED | ROW | ||||
ROW | ROW | ||||
STATEMENT | BINLOG_FORMAT =
STATEMENT | ||||
MIXED | ROW | ||||
ROW | ROW | ||||
STATEMENT | BINLOG_FORMAT =
STATEMENT | - | |||
MIXED | ROW | ||||
ROW | ROW | ||||
STATEMENT | STATEMENT | ||||
MIXED | STATEMENT | ||||
ROW | ROW | ||||
STATEMENT | BINLOG_FORMAT =
STATEMENT | STATEMENT | |||
MIXED | ROW | ||||
ROW | ROW | ||||
STATEMENT | BINLOG_FORMAT =
STATEMENT | ||||
MIXED | ROW | ||||
ROW | ROW |
SHOW WARNINGS
log_error_verbosity
mysql
INSERT
DELETE
GRANT
CREATE USER
mysql
binlog_format
INSERT
UPDATE
DELETE
REPLACE
DO
LOAD DATA
INFILE
SELECT
TRUNCATE TABLE
mysql
binlog_format
GRANT
REVOKE
SET PASSWORD
RENAME USER
CREATE TABLE
... SELECT
DROP
CREATE TABLE ...
SELECT
CREATE TABLE
SELECT
binlog_format
long_query_time
min_examined_row_limit
long_query_time
log_slow_admin_statements
log_queries_not_using_indexes
--slow_query_log[={0|1}]
--slow_query_log
--slow_query_log_file=
file_name
--log-output
host_name
-slow.log
slow_query_log
slow_query_log_file
slow_query_log
ON
slow_query_log_file
--log-output
log_output
NONE
--log-short-format
log_slow_admin_statements
ALTER TABLE
ANALYZE TABLE
CHECK TABLE
CREATE INDEX
DROP INDEX
OPTIMIZE TABLE
REPAIR TABLE
log_queries_not_using_indexes
log_throttle_queries_not_using_indexes
log_slow_admin_statements
long_query_time
log_queries_not_using_indexes
min_examined_row_limit
log_throttle_queries_not_using_indexes
log_timestamps
CONVERT_TZ()
time_zone
log_slow_slave_statements
DROP TABLE
ALTER TABLE
t1
ALTER
TABLE t3 DROP PARTITION p2
ddl_log.log
ddl_log.log
ddl_log.log
mysql-log-rotate
binlog_expire_logs_seconds
PURGE BINARY LOGS
FLUSH LOGS
max_binlog_size
FLUSH LOGS
FLUSH BINARY LOGS
--log-error
mysql.log
shell>cd
shell>mysql-data-directory
mv mysql.log mysql.old
shell>mv mysql-slow.log mysql-slow.old
shell>mysqladmin flush-logs
mysql.old
SET GLOBAL general_log = 'OFF'; SET GLOBAL slow_query_log = 'OFF';
SET GLOBAL general_log = 'ON'; SET GLOBAL slow_query_log = 'ON';
/var/log/mysqld.log
root
root
内核> mv /var/log/mysqld.log /var/log/mysqld.log.old
内核> install -omysql -gmysql -m0644 /dev/null /var/log/mysqld.log
INSTALL COMPONENT
UNINSTALL COMPONENT
安装组件:组件_文件/卸载组件_密码验证”;“文件/ _ _组件验证密码;
mysql.component
mysql.component
INSTALL COMPONENT
mysql.component
--skip-grant-tables
UNINSTALL COMPONENT
INSTALL
PLUGIN
INSTALL COMPONENT
INSTALL
COMPONENT
SELECT * FROM mysql.component;
log_filter_dragnet
dragnet.log_error_filter_rules
log_error_services
log_error_services
INSTALL COMPONENT
UNINSTALL COMPONENT
log_error_services
log_error_services
log_error_services
log_error_verbosity
INSTALL COMPONENT
log_error_verbosity
log_error_verbosity
dragnet.log_error_filter_rules
file://component_log_filter_dragnet
log_error
INSTALL COMPONENT
file://component_log_sink_json
log_error
log_error
NN
NN
log_error
file_name
log_error_services
file_name
file_name
log_error
log_json_writer
log_error_services
syslog
file://component_log_sink_syseventlog
file://component_log_sink_test
INFORMATION_SCHEMA
version_tokens
INFORMATION_SCHEMA.PLUGINS
SHOW PLUGINS
plugin_name
csv
--
plugin_name
[=activation_state
]
mysql.plugin
mysql.plugin
--
plugin_name
[=activation_state
]
--skip-grant-tables
--plugin-load
--plugin-load-add
--early-plugin-load
plugin_name
[=activation_state
--plugin-load
--plugin-load-add
--early-plugin-load
name
=
plugin_library
plugin_library
name
plugin_library
plugin_dir
mysql.plugin
--plugin-load
--plugin-load-add
--early-plugin-load
--plugin-load
--plugin-load-add
--early-plugin-load
--skip-grant-tables
--plugin-load
--plugin-load-add
--early-plugin-load
--plugin-load-add
--plugin-load
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load-add
--plugin-load
--plugin-load
--plugin-load=x --plugin-load-add=y
--plugin-load="x;y"
--plugin-load-add=y --plugin-load=x
--plugin-load=x
INSTALL PLUGIN
INSTALL PLUGIN
INSTALL PLUGIN
INSERT
.so
--plugin-load
somepluglib.so
[mysqld] plugin-load=myplugin=somepluglib.so
mysql.plugin
--plugin-load
INSTALL PLUGIN
安装插件myplugin somepluglib.so soname ' ';
INSTALL PLUGIN
mysql.plugin
INSTALL
PLUGIN
MySQL的> INSTALL PLUGIN myplugin SONAME 'somepluglib.so';
错误1721(hy000):插件的myplugin”标为不dynamicallyinstallable。你必须停止服务器安装。
--plugin-load
--plugin-load-add
--early-plugin-load
--plugin-load
--plugin-load-add
--early-plugin-load
INSTALL
PLUGIN
[ERROR] Function 'plugin_name
' already exists [Warning] Couldn't load plugin named 'plugin_name
' with soname 'plugin_object_file
'.
--plugin-load
--
plugin_name
[=activation_state
]plugin_name
csv
--my_plugin=ON
--my-plugin=on
--
plugin_name
=OFF
mysql_native_password
--
plugin_name
[=ON]
--
plugin_name
--
plugin_name
=FORCE
--
plugin_name
=FORCE_PLUS_PERMANENT
FORCE
UNINSTALL PLUGIN
LOAD_OPTION
INFORMATION_SCHEMA.PLUGINS
CSV
ARCHIVE
BLACKHOLE
[mysqld] csv=ON blackhole=FORCE archive=OFF
--enable-
plugin_name
plugin_name
=ONplugin_name
plugin_name
plugin_name
=OFF
OFF
NO_ENGINE_SUBSTITUTION
--skip-innodb
InnoDB
xxx
InnoDB
--default_storage_engine
--default_tmp_storage_engine
UNINSTALL PLUGIN
UNINSTALL
PLUGIN
DELETE
UNINSTALL PLUGIN
INSTALL PLUGIN
NULL
INFORMATION_SCHEMA.PLUGINS
SHOW PLUGINS
--
plugin_name
=FORCE_PLUS_PERMANENTINFORMATION_SCHEMA.PLUGINS
my.cnf
INSTALL
PLUGIN
INSTALL PLUGIN
INFORMATION_SCHEMA.PLUGINS
SHOW PLUGINS
UNINSTALL PLUGIN
INFORMATION_SCHEMA.PLUGINS
NULL
MySQL的> SELECT * FROM INFORMATION_SCHEMA.PLUGINS\G
*************************** 1。行*************************** plugin_name:binlog plugin_version:1 plugin_status:主动plugin_type:存储引擎plugin_type_version:50158 plugin_library:nullplugin_library_version:空plugin_author:MySQL AB plugin_description:这是一个伪存储引擎在一个交易plugin_license代表binlog:GPL load_option:力…*************************** 10。行*************************** plugin_name:InnoDB plugin_version:1 plugin_status:主动plugin_type:存储引擎plugin_type_version:50158 plugin_library:ha_innodb_plugin.soplugin_library_version:plugin_author:1级公司plugin_description:支持事务,行级锁,和外键plugin_license:GPL load_option:对…
SHOW PLUGINS
NULL
MySQL的> SHOW PLUGINS\G
*************************** 1。行***************************名称:binlog状态:活跃型:存储enginelibrary:nulllicense:GPL *************************** 10。行***************************名称:InnoDB状态:活跃型:存储enginelibrary:ha_innodb_plugin.solicense:GPL…
mysql.plugin
INSTALL
PLUGIN
PLUGINS
SHOW PLUGINS
InnoDB
INFORMATION_SCHEMA
TP_THREAD_STATE
TP_THREAD_GROUP_STATE
TP_THREAD_GROUP_STATS
thread_handling
thread_pool_algorithm
thread_pool_high_priority_connection
thread_pool_prio_kickup_timer
thread_pool_max_unused_threads
thread_pool_size
thread_pool_stall_limit
SELECT * FROM performance_schema.setup_instruments WHERE NAME LIKE '%thread_pool%';
plugin_dir
plugin_dir
thread_pool
.dll
--plugin-load-add
my.cnf
[mysqld] plugin-load-add=thread_pool.so
[mysqld] plugin-load-add=thread_pool=thread_pool.so plugin-load-add=tp_thread_state=thread_pool.so plugin-load-add=tp_thread_group_state=thread_pool.so plugin-load-add=tp_thread_group_stats=thread_pool.so
INFORMATION_SCHEMA
[mysqld]plugin-load-add=thread_pool=thread_pool.so
TP_THREAD_STATE
[mysqld] plugin-load-add=thread_pool=thread_pool.so plugin-load-add=tp_thread_state=thread_pool.so
INFORMATION_SCHEMA
INFORMATION_SCHEMA.PLUGINS
SHOW PLUGINS
mysql>SELECT PLUGIN_NAME, PLUGIN_STATUS
FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME LIKE 'thread%' OR PLUGIN_NAME LIKE 'tp%';
+-----------------------+---------------+ | PLUGIN_NAME | PLUGIN_STATUS | +-----------------------+---------------+ | thread_pool | ACTIVE | | TP_THREAD_STATE | ACTIVE | | TP_THREAD_GROUP_STATE | ACTIVE | | TP_THREAD_GROUP_STATS | ACTIVE | +-----------------------+---------------+
thread_handling
thread_pool_size
thread_pool_stall_limit
thread_pool_high_priority_connection
autocommit
MyISAM
MyISAM
autocommit
autocommit
thread_pool_prio_kickup_timer
max_connections
thread_pool_size
thread_pool_size
InnoDB
thread_pool_size
InnoDB
MyISAM
thread_pool_size
thread_pool_stall_limit
thread_pool_stall_limit
thread_pool_stall_limit
thread_pool_stall_limit
thread_pool_stall_limit
thread_pool_stall_limit
thread_pool_stall_limit
thread_pool_stall_limit
SELECT SUM(STALLED_QUERIES_EXECUTED) / SUM(QUERIES_EXECUTED) FROM INFORMATION_SCHEMA.TP_THREAD_GROUP_STATS;
thread_pool_stall_limit
thread_pool_prio_kickup_timer
thread_pool_stall_limit
Rewriter
Rewriter
Rewriter
rewrite_rules
query_rewrite
load_rewrite_rules()
Rewriter
Rewriter
Rewriter
Rewriter
install_rewriter.sql
uninstall_rewriter.sql
shell>mysql -u root -p < install_rewriter.sql
Enter password:(enter root password here)
install_rewriter.sql
mysql> SHOW GLOBAL VARIABLES LIKE 'rewriter_enabled';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| rewriter_enabled | ON |
+------------------+-------+
rewriter_enabled
[mysqld] rewriter_enabled=ON
SET GLOBAL rewriter_enabled = ON; SET GLOBAL rewriter_enabled = OFF;
Rewriter
query_rewrite
Rewriter
flush_rewrite_rules()
query_rewrite.rewrite_rules(插入模式,更换)值('select?”,选择?1');
mysql> SELECT * FROM query_rewrite.rewrite_rules\G
*************************** 1. row ***************************
id: 1
pattern: SELECT ?
pattern_database: NULL
replacement: SELECT ? + 1
enabled: YES
message: NULL
pattern_digest: NULL
normalized_pattern: NULL
SELECT
Rewriter
mysql> CALL query_rewrite.flush_rewrite_rules();
flush_rewrite_rules()
normalized_pattern
mysql> SELECT * FROM query_rewrite.rewrite_rules\G
*************************** 1. row ***************************
id: 1
pattern: SELECT ?
pattern_database: NULL
replacement: SELECT ? + 1
enabled: YES
message: NULL
pattern_digest: d1b44b0c19af710b5a679907e284acd2ddc285201794bc69a2389d77baedddae
normalized_pattern: select ?
flush_rewrite_rules()
MySQL的> CALL query_rewrite.flush_rewrite_rules();
错误1644(45000):一些规则加载(S)失败。
message
NULL
?
?
mysql>SELECT PI();
+----------+ | PI() | +----------+ | 3.141593 | +----------+ 1 row in set (0.01 sec) mysql>SELECT 10;
+--------+ | 10 + 1 | +--------+ | 11 | +--------+ 1 row in set, 1 warning (0.00 sec)
SELECT
SHOW WARNINGS
MySQL的> SHOW WARNINGS\G
*************************** 1。行***************************水平:注意代码:1105message:查询“选择10”改写“10 1”选择的查询重写插件
DELETE
UPDATE
INSERT INTO query_rewrite.rewrite_rules (pattern, replacement)VALUES('DELETE FROM db1.t1 WHERE col = ?', 'UPDATE db1.t1 SET col = NULL WHERE col = ?');CALL query_rewrite.flush_rewrite_rules();
enabled
UPDATE query_rewrite.rewrite_rules SET enabled = 'NO' WHERE id = 1;CALL query_rewrite.flush_rewrite_rules();
UPDATE query_rewrite.rewrite_rules SET enabled = 'YES' WHERE id = 1; CALL query_rewrite.flush_rewrite_rules();
rewrite_rules
Rewriter
pattern_database
appdb.users
appdb
SELECT * FROM users WHERE appdb.id =id_value
;SELECT * FROM users WHERE id =id_value
;
id
id
user_id
WHERE
Rewriter
INSERT INTO query_rewrite.rewrite_rules (pattern, replacement) VALUES( 'SELECT * FROM appdb.users WHERE id = ?', 'SELECT * FROM appdb.users WHERE user_id = ?' );INSERT INTO query_rewrite.rewrite_rules (pattern, replacement, pattern_database) VALUES( 'SELECT * FROM users WHERE id = ?', 'SELECT * FROM users WHERE user_id = ?', 'appdb' );CALL query_rewrite.flush_rewrite_rules();
Rewriter
pattern_database
Rewriter
?
?
message
Rewriter_reload_error
?
Rewriter
SELECT ?, 3
SELECT
PREPARE s AS 'SELECT 3, 3' | |
PREPARE s AS 'SELECT ?, 3' | |
PREPARE s AS 'SELECT 3, ?' | |
PREPARE s AS 'SELECT ?, ?' |
Rewriter
MySQL的> SHOW GLOBAL STATUS LIKE 'Rewriter%';
----------------------------------- ------- | variable_name |价值| ----------------------------------- ------- | rewriter_number_loaded_rules | 1 | | rewriter_number_reloads |五| | rewriter_number_rewritten_queries | 1 | | rewriter_reload_error |在| ----------------------------------- -------
flush_rewrite_rules()
Rewriter_reload_error
mysql>CALL query_rewrite.flush_rewrite_rules();
ERROR 1644 (45000): Loading of some rule(s) failed. mysql>SHOW GLOBAL STATUS LIKE 'Rewriter_reload_error';
+-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | Rewriter_reload_error | ON | +-----------------------+-------+
rewrite_rules
message
rewrite_rules
character_set_client
character_set_client
character_set_client
Rewriter
Rewriter
Rewriter
Rewriter
rewrite_rules
Rewriter
message
flush_rewrite_rules
rewrite_rules
id
pattern
?
pattern_database
pattern_database
replacement
pattern
?
pattern
enabled
flush_rewrite_rules()
YES
YES
message
message
NULL
?
Rewriter_reload_error
pattern_digest
normalized_pattern
Rewriter
flush_rewrite_rules()
load_rewrite_rules()
Rewriter
flush_rewrite_rules()
COMMIT
message
Rewriter_reload_error
load_rewrite_rules()
flush_rewrite_rules()
Rewriter
rewriter_enabled | |
ON |
Rewriter
rewriter_verbose | |
Rewriter
rewrite_rules
rewrite_rules
Rewriter_number_rewritten_queries
Rewriter
rewrite_rules
OFF
message
version_tokens
VERSION_TOKEN_ADMIN
SUPER
version_tokens
VERSION_TOKEN_ADMIN
plugin_dir
plugin_dir
version_tokens
.dll
INSTALL PLUGIN
CREATE FUNCTION
INSTALL PLUGIN version_tokens SONAME 'version_token.so'; CREATE FUNCTION version_tokens_set RETURNS STRING SONAME 'version_token.so'; CREATE FUNCTION version_tokens_show RETURNS STRING SONAME 'version_token.so'; CREATE FUNCTION version_tokens_edit RETURNS STRING SONAME 'version_token.so'; CREATE FUNCTION version_tokens_delete RETURNS STRING SONAME 'version_token.so'; CREATE FUNCTION version_tokens_lock_shared RETURNS INT SONAME 'version_token.so'; CREATE FUNCTION version_tokens_lock_exclusive RETURNS INT SONAME 'version_token.so'; CREATE FUNCTION version_tokens_unlock RETURNS INT SONAME 'version_token.so';
UNINSTALL PLUGIN
DROP FUNCTION
卸载插件version_tokens;降功能version_tokens_set;降功能version_tokens_show;降功能version_tokens_edit;降功能version_tokens_delete;降功能version_tokens_lock_shared;降功能version_tokens_lock_exclusive;降功能version_tokens_unlock;
VERSION_TOKEN_ADMIN
SUPER
emp
read
version_token_set()
mysql> SELECT version_tokens_set('emp=read;prod=read');
+------------------------------------------+
| version_tokens_set('emp=read;prod=read') |
+------------------------------------------+
| 2 version tokens set. |
+------------------------------------------+
mysql> SELECT version_tokens_set('emp=write;prod=read');
+-------------------------------------------+
| version_tokens_set('emp=write;prod=read') |
+-------------------------------------------+
| 2 version tokens set. |
+-------------------------------------------+
mysql> SELECT version_tokens_set('emp=read;prod=write');
+-------------------------------------------+
| version_tokens_set('emp=read;prod=write') |
+-------------------------------------------+
| 2 version tokens set. |
+-------------------------------------------+
name
=value
emp
prod
emp
mysql> SET @@session.version_tokens_session = 'emp=write';
mysql>UPDATE emp.employee SET salary = salary * 1.1 WHERE id = 4981;
Query OK, 1 row affected (0.07 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql>SELECT last_name, first_name FROM emp.employee WHERE id = 4981;
+-----------+------------+ | last_name | first_name | +-----------+------------+ | Smith | Abe | +-----------+------------+ 1 row in set (0.01 sec)
version_tokens_session
ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND
version_tokens_session
ER_VTOKEN_PLUGIN_TOKEN_MISMATCH
emp
emp
mysql> SELECT version_tokens_edit('emp=write');
+----------------------------------+
| version_tokens_edit('emp=write') |
+----------------------------------+
| 1 version tokens updated. |
+----------------------------------+
mysql> SELECT version_tokens_edit('emp=read');
+---------------------------------+
| version_tokens_edit('emp=read') |
+---------------------------------+
| 1 version tokens updated. |
+---------------------------------+
version_tokens_edit()
mysql> UPDATE emp.employee SET salary = salary * 1.1 WHERE id = 4982;
ERROR 3136 (42000): Version token mismatch for emp. Correct value read
'emp=read'
version_tokens_session
version_tokens_set()
name
=value
version_tokens_edit()
name
=value
version_tokens_delete()
version_tokens_show()
mysql>SELECT version_tokens_set('tok1=a;tok2=b');
+-------------------------------------+ | version_tokens_set('tok1=a;tok2=b') | +-------------------------------------+ | 2 version tokens set. | +-------------------------------------+ mysql>SELECT version_tokens_edit('tok3=c');
+-------------------------------+ | version_tokens_edit('tok3=c') | +-------------------------------+ | 1 version tokens updated. | +-------------------------------+ mysql>SELECT version_tokens_delete('tok2;tok1');
+------------------------------------+ | version_tokens_delete('tok2;tok1') | +------------------------------------+ | 2 version tokens deleted. | +------------------------------------+ mysql>SELECT version_tokens_show();
+-----------------------+ | version_tokens_show() | +-----------------------+ | tok3=c; | +-----------------------+
mysql>SELECT version_tokens_set('tok1=a; =c');
+----------------------------------+ | version_tokens_set('tok1=a; =c') | +----------------------------------+ | 1 version tokens set. | +----------------------------------+ 1 row in set, 1 warning (0.00 sec) mysql>SHOW WARNINGS\G
*************************** 1. row *************************** Level: Warning Code: 42000 Message: Invalid version token pair encountered. The list provided is only partially updated. 1 row in set (0.00 sec)
name
=value
mysql> SELECT version_tokens_set('tok1=b;;; tok2= a = b ; tok1 = 1\'2 3"4')
+---------------------------------------------------------------+
| version_tokens_set('tok1=b;;; tok2= a = b ; tok1 = 1\'2 3"4') |
+---------------------------------------------------------------+
| 3 version tokens set. |
+---------------------------------------------------------------+
version_tokens_delete()
version_tokens_set()
1'2 3"4
a = b
mysql> SELECT version_tokens_show();
+--------------------------+
| version_tokens_show() |
+--------------------------+
| tok2=a = b;tok1=1'2 3"4; |
+--------------------------+
version_tokens_set()
tok1
=
;
max_allowed_packet
version_tokens_lock_exclusive()
version_tokens_lock_shared()
version_tokens_unlock()
mysql>SELECT version_tokens_lock_shared('lock1', 'lock2', 0);
+-------------------------------------------------+ | version_tokens_lock_shared('lock1', 'lock2', 0) | +-------------------------------------------------+ | 1 | +-------------------------------------------------+ mysql>SELECT version_tokens_lock_shared(NULL, 0);
ERROR 3131 (42000): Incorrect locking service lock name '(null)'.
version_token_locks
=
VERSION_TOKEN_ADMIN
SUPER
name_list
token_list
version_tokens_delete(
name_list
)
name_list
name_list
MySQL的> SELECT version_tokens_delete('tok1;tok3');
------------------------------------ |版本_戳标记_删除(“tok1;tok3”)| ------------------------------------ | 2版本戳标记deleted。| ------------------------------------
NULL
version_tokens_delete()
version_tokens_set()
MySQL的> SELECT version_tokens_set(NULL);
------------------------------ | version_tokens_set(空)| ------------------------------ |版本标记列表中清除。MySQL SELECT version_tokens_set('');
------------------------------ | version_tokens_set('')| ------------------------------ |版本标记列表中清除。| ------------------------------
version_tokens_edit(
token_list
)
token_list
token_list
name
=value
mysql>SELECT version_tokens_set('tok1=value1;tok2=value2');
+-----------------------------------------------+ | version_tokens_set('tok1=value1;tok2=value2') | +-----------------------------------------------+ | 2 version tokens set. | +-----------------------------------------------+ mysql>SELECT version_tokens_edit('tok2=new_value2;tok3=new_value3');
+--------------------------------------------------------+ | version_tokens_edit('tok2=new_value2;tok3=new_value3') | +--------------------------------------------------------+ | 2 version tokens updated. | +--------------------------------------------------------+
version_tokens_set(
token_list
)
token_list
token_list
name
=value
mysql> SELECT version_tokens_set('tok1=value1;tok2=value2');
+-----------------------------------------------+
| version_tokens_set('tok1=value1;tok2=value2') |
+-----------------------------------------------+
| 2 version tokens set. |
+-----------------------------------------------+
version_tokens_show()
name
=value
MySQL的> SELECT version_tokens_show();
+--------------------------+| version_tokens_show() |+--------------------------+| tok2=value2;tok1=value1; |+--------------------------+
version_tokens_lock_exclusive(
token_name
[,
token_name
] ...,
timeout
)
mysql> SELECT version_tokens_lock_exclusive('lock1', 'lock2', 10);
+-----------------------------------------------------+
| version_tokens_lock_exclusive('lock1', 'lock2', 10) |
+-----------------------------------------------------+
| 1 |
+-----------------------------------------------------+
version_tokens_lock_shared(
token_name
[,
token_name
] ...,
timeout
)
mysql> SELECT version_tokens_lock_shared('lock1', 'lock2', 10);
+--------------------------------------------------+
| version_tokens_lock_shared('lock1', 'lock2', 10) |
+--------------------------------------------------+
| 1 |
+--------------------------------------------------+
version_tokens_unlock()
version_tokens_lock_exclusive()
mysql> SELECT version_tokens_unlock();
+-------------------------+
| version_tokens_unlock() |
+-------------------------+
| 1 |
+-------------------------+
=
--version-tokens-session=value | |
version_tokens_session | |
NULL |
version_tokens_session
version_tokens_session
version_tokens_session
ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND
version_tokens_session
ER_VTOKEN_PLUGIN_TOKEN_MISMATCH
version_tokens_session
mysql> SELECT version_tokens_set('tok1=a;tok2=b;tok3=c');
+--------------------------------------------+
| version_tokens_set('tok1=a;tok2=b;tok3=c') |
+--------------------------------------------+
| 3 version tokens set. |
+--------------------------------------------+
version_tokens_session
version_tokens_session
MySQL的> SET @@session.version_tokens_session = 'tok1=a;tok2=b';
MySQL的> SELECT 1;
我| | - 1 - 1 | |——MySQL > SET @@session.version_tokens_session = 'tok1=b';
MySQL的> SELECT 1;
错误3136(42000):版本不匹配TOK1令牌。正确的价值
SELECT
tok2
SELECT
mysql>SELECT version_tokens_edit('tok1=b');
+-------------------------------+ | version_tokens_edit('tok1=b') | +-------------------------------+ | 1 version tokens updated. | +-------------------------------+ mysql>SELECT version_tokens_show();
+-----------------------+ | version_tokens_show() | +-----------------------+ | tok3=c;tok1=b;tok2=b; | +-----------------------+
version_tokens_session
MySQL的> SELECT 1;
--- | 1 | --- | 1 | ---
--version-tokens-session-number=N | |
version_tokens_session_number | |
0 |
SHOW
VARIABLES
--datadir=
dir_name
--port
--bind-address
--socket={
file_name
|pipe_name
}
--socket
--shared-memory-base-name=
name
--basedir=
dir_name
--socket
--port
--basedir
--socket
--port
--defaults-file
--datadir=
dir_name
MyISAM
lockd
data
data
my.cnf
--defaults-file
C:\mydata1
mysql
C:\my-opts1.cnf
[mysqld]datadir = C:/mydata1port = 3307
C:\my-opts2.cnf
[mysqld]datadir = C:/mydata2port = 3308
--defaults-file
C:\> C:\mysql\bin\mysqld --defaults-file=C:\my-opts1.cnf
C:\> C:\mysql\bin\mysqld --defaults-file=C:\my-opts2.cnf
C:\>C:\mysql\bin\mysqladmin --port=3307 --host=127.0.0.1 --user=root --password shutdown
C:\>C:\mysql\bin\mysqladmin --port=3308 --host=127.0.0.1 --user=root --password shutdown
C:\my-opts1.cnf
[mysqld]datadir = C:/mydata1port = 3307enable-named-pipesocket = mypipe1
C:\my-opts2.cnf
--shared-memory
--shared-memory-base-name
C:\mysql-5.5.9
--install
mysqld1
mysqld2
[mysqld2]
# options for mysqld1 service [mysqld1] basedir = C:/mysql-5.5.9 port = 3307 enable-named-pipe socket = mypipe1 # options for mysqld2 service [mysqld2] basedir = C:/mysql-8.0.14 port = 3308 enable-named-pipe socket = mypipe2
C:\>C:\mysql-5.5.9\bin\mysqld --install mysqld1
C:\>C:\mysql-8.0.14\bin\mysqld --install mysqld2
C:\>NET START mysqld1
C:\>NET START mysqld2
C:\>NET STOP mysqld1
C:\>NET STOP mysqld2
--defaults-file
C:\my-opts1.cnf
[mysqld]basedir = C:/mysql-5.5.9port = 3307enable-named-pipesocket = mypipe1
C:\my-opts2.cnf
[mysqld]basedir = C:/mysql-8.0.14port = 3308enable-named-pipesocket = mypipe2
C:\>C:\mysql-5.5.9\bin\mysqld --install mysqld1
--defaults-file=C:\my-opts1.cnf
C:\>C:\mysql-8.0.14\bin\mysqld --install mysqld2
--defaults-file=C:\my-opts2.cnf
--defaults-file
--remove
/tmp/mysql.sock
shell>cmake . -DMYSQL_TCP_PORT=
port_number
\-DMYSQL_UNIX_ADDR=
file_name
\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-8.0.14
port_number
file_name
CMAKE_INSTALL_PREFIX
shell> mysqladmin --host=host_name
--port=port_number
variables
localhost
--protocol={TCP|SOCKET|PIPE|MEMORY}
shell> mysqld_safe --socket=file_name
--port=port_number
--socket
--port
--datadir=
dir_name
--defaults-file
/usr/local/mysql/my.cnf2
内核> mysqld_safe --defaults-file=/usr/local/mysql/my.cnf
内核> mysqld_safe --defaults-file=/usr/local/mysql/my.cnf2
shell>MYSQL_UNIX_PORT=/tmp/mysqld-new.sock
shell>MYSQL_TCP_PORT=3307
shell>export MYSQL_UNIX_PORT MYSQL_TCP_PORT
shell>bin/mysqld --initialize --user=mysql
shell>mysqld_safe --datadir=/path/to/datadir &
--host=
host_name
--port=
port_number
--host=127.0.0.1
--port=
port_number
--host=localhost
--socket=
file_name
--protocol=TCP
--protocol=SOCKET
--protocol=PIPE
--protocol=MEMORY
--host
--port
--socket
--shared-memory-base-name
MYSQL_UNIX_PORT
.login
[client]
.my.cnf
mysql_real_connect()
mysql_options()
DBD::mysql
$dsn = "DBI:mysql:test;mysql_read_default_group=client;" . "mysql_read_default_file=/usr/local/mysql/data/my.cnf";$dbh = DBI->connect($dsn, $user, $password);