In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "MySQL how to configure the server", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "MySQL how to configure the server" this article.
MySQL server configuration
1. Server configuration
1.1. MySQL configuration options
Startup options can be specified on the command line or in the configuration file when the server (or client) is invoked. The MySQL client program looks for the configuration file at startup and uses the appropriate options.
By default, the server uses the precompiled values of its configuration variables at run time. However, if the default value is not appropriate for the environment, you can add a run-time option to let the server use other values to do the following:
Specify the location of important directories and files
Control the log files written by the server
Z. overrides the built-in values of server performance-related variables (that is, controls the maximum number of simultaneous connections and the size of buffers and caches)
Enable or disable the precompiled storage engine when the server starts
By using command-line options or configuration files, or a combination of both, you can specify run-time options at server startup (to change its configuration and behavior). The command line option takes precedence over any setting in the configuration file. To understand the options supported by the server, execute the following command at the shell prompt:
Mysqld-verbose-help
Note: the above command provides information. This command does not start the MySQL server.
1) what are the reasons for using configuration files?
When you invoke a server from the command line, you can specify any of the server options listed by the-- help option. However, it is more useful to list them in the configuration file for the following reasons:
a. After you put the options in a file, you do not need to specify the options on the command line every time you start the server. For complex options, such as those for configuring InnoDB tablespaces, this is more convenient and less error-prone.
b. If all server options are in one configuration file, you can provide an overview of the server configuration.
MySQL programs can access options in multiple configuration files. The program looks for each standard profile and reads any configuration files that exist. No error occurs when the specified file is not found.
To use a configuration file, use an editor to create the file as a plain text file. To create or modify a configuration file, you must have write access to the file. The client program only needs read access.
2) profile group
The options in the configuration file are organized by groups, with each group preceded by a [group-name] line named for the group. Typically, the group name is the category or name of the program to which the option group applies. Examples of option groups include:
[client]: used to specify options that apply to all client programs. A common use of the [client] group is to specify connection parameters, because in general, no matter what client program is used, a connection to the same server is established.
[mysql] and [mysqldump]: used to specify options for mysql and mysqldump clients, respectively. In addition, other client options can be specified separately.
[server]: lets you specify options that apply to both mysqld and mysqld_safe server programs.
[mysqld], [mysqld-5.6], and [mysqld_safe]: used to specify options for different server versions or startup methods.
3) write configuration files
A short example of a group in a profile:
[client]
Host = myhost.example.com
Compress
[mysql]
Show-warnings
To create or modify a profile, the end user must have write access to the file. The server itself only needs read access; the server reads the configuration file but does not create or modify the configuration file. Write an option in the configuration file:
Use the long option format (as used on the command line), but omit the leading dash.
If an option has a value, it is allowed to add a space (=) to the equal sign. This rule does not apply to options specified on the command line.
In the example, note the following:
[client]: the options in this group apply to all standard clients.
-host: specify the server hostname
-compress: instructs the client / server protocol to use compression for communications sent over the network
[mysql]: the options in this group apply only to mysql clients.
-show-warnings: instructs MySQL to display any current warnings after each statement
The mysql client uses both the options in the [client] and [mysql] groups, so all three options displayed will be used.
4) profile location
The MySQL server looks for files in the standard location. The standard files for Linux and Windows are different. In Linux, my.cnf files are used. In Windows, use the my.ini file.
You can use the following options to view profile lookup locations and groups:
Shell > mysql-- help
The standard configuration file is as follows:
Linux: the file / etc/my.cnf is used as a global configuration file for all users. You can create a user-specific profile .my.cnf in the user's home directory. If the MYSQL_HOME environment variable is set, the $MYSQL_HOME/my.cnf file is searched.
Windows: the program looks for configuration files in the following order: my.ini and my.cnf under the Windows C:\ directory, followed by the C:\ Windows (or C:\ WinNT) directory. However, because the Windows installation wizard places the configuration file in the directory C:\ Program Files\ MySQL\ MySQL Server, the server also searches this directory in Windows.
The MySQL command line program searches for configuration files in the MySQL installation directory.
5) Startup options in the configuration file
To specify server options in the configuration file, indicate specific options under the [mysqld] or [server] group.
Logging: you can enable logging for the server by enabling the type of logs you want. The following options enable general query logs, binary logs, and slow query logs:
General_log
Log-bin
Slow_query_log
Default storage engine: you can use the-- default-storage-engine option to specify a default storage engine that is different from InnoDB.
System variable: you can customize the server by setting the server system variable value. For example, to increase the maximum number of connections allowed and the default value for the number of InnoDB buffer pools, set the following variables:
Max_connections=200
Innodb_buffer_pool_instances=4
Shared memory: not enabled by default on Windows. You can use the shared-memory option to enable named pipe support.
Named pipes: to enable named pipe support, use the enable-named-pipe option.
6) sample configuration file
A sample configuration file is provided with the MySQL installation: my-default.cnf. Linux for RPM installation, the sample configuration file is in / usr/share/mysql; for TAR file installation, the sample file is in the share directory under the MySQL installation directory. Windows: the configuration file is located in the MySQL installation directory (my.ini).
The installation process copies this file to / etc/my.cnf. If the file already exists, copy it to / etc/my-new.cnf. Specify new options in this file to replace, add, or ignore standard options. Must be the first option on the command line:
-- defaults-file=
-- defaults-extra-file=
-- no-defaults
Before changing any default options, make sure that you fully understand the impact of the corresponding options on server operation. For example, some settings enable specific log files or change the size of the memory buffer.
-- defaults-file=: uses the configuration file at the specified location.
-- defaults-extra-file=: uses other configuration files at the specified location.
-- no-defaults: ignore all configuration files.
For example, to use only the / etc/my-opts.cnf file and ignore the standard configuration file, you can invoke the program like this:
Shell > mysql-- defaults-file=/etc/my-opts.cnf
If you specify an option multiple times, whether in the same profile or in multiple profiles, the last option value takes precedence.
For more information about using configuration files, see the MySQL reference Manual:
Http://dev.mysql.com/doc/refman/5.6/en/option-files.html .
7) display options in the configuration file
You can view the options used by programs that read a specific set of options by executing the mysql client with the-- print-defaults option or by using the my_print_defaults utility. The output consists of a variety of options, each on a line, in the same form as when options are specified on the command line. This output varies depending on the profile settings.
My_print_defaults accepts the following options:
-- help, -?: displays help and exits.
-config-file=,-defaults-file=,
-c: only the specified configuration file is read.
-- debug=,-#: write debug log.
-- defaults-extra-file=,-- extra-file=,-e: read this profile after the global profile, but before the user profile (on Linux).
-- defaults-group-suffix=,-g: reads groups with suffixes.
-- no-defaults,-n: returns an empty string.
-- verbose,-v: detailed mode. Output more information about the behavior of the program.
-- version,-V: displays version information and exits.
Display options by group from the command line. Examples of [mysql] and [client] groups:
Shell > my_print_defaults mysql client
-- user=myusername
-- password=secret
-- host=localhost
-- port=3306
-- character-set-server=latin1
Or (for the same output):
Mysql-print-defaults mysql client
8) masking verification options
It is not recommended to use the mysql-uroot-poracle form to specify a password on the command line. For convenience, the password can be placed in the [client] option group, but the password is stored in plain text and can be easily seen by anyone with read access to the configuration file. Using the mysql_config_editor utility, you can store authentication credentials in an encrypted login file. Mylogin.cnf. On Linux and UNIX, the file location is the home directory of the current user, and on Windows it is the% APPDATA%\ MySQL directory. The MySQL client program can later read the file to obtain the authentication credentials used to connect to the MySQL server. The encryption method is reversible, so you should not assume that the credential is secure for anyone who has access to the file. Instead, this feature makes it easier to avoid using plain text credentials.
The unencrypted format of the .mylogin.cnf login file consists of option groups, similar to other configuration files. Each option group in .mylogin.cnf is called the login path and allows only a limited set of options: host, user, and password. You can think of the login path as a set of values that indicate the server host and the credentials used for server authentication.
Here is an example:
[admin]
User = root
Password = oracle
Host = 127.0.0.1
Shell > mysql-- login-path=admin
9) Login path
Create a login path:
Mysql_config_editor-login-path=-user=-password-host=
View a single login path in plain text:
Mysql_config_editor print-login-path=
View all login paths in plain text:
Mysql_config_editor print-all
Delete the login path:
Mysql_config_editor remove-login-path=
The default login path name is client, which is read by all standard clients
If the-- login-path option is not used when calling mysql_config_editor, the [client] login path is used. By default, all standard clients use this login path.
For example, the following command creates a [client] login path that all standard clients use:
Shell > mysql_config_editor set-- user=root-- password
Enter password: oracle
Failure to provide command-line arguments or configuration files when calling standard clients results in reading the [client] login path in the .mylogin.cnf file and the [client] option group in any configuration file. For example, the following output shows the result of invoking the mysql client without providing any options (the previous command has been executed):
Shell > mysql
Welcome to the MySQL monitor. Commands end with; or\ g.
...
1.2. Server system variabl
The MySQL server maintains a number of server system variables that indicate the configuration of the server. Use the mysqld-- verbose-- help command under shell to view the values used by the server based on its internal compiled default values, as well as any configuration files read by the server, and use the mysqld-- no-defaults-- verbose-- help command under shell to view the values used by the server based on its internal compiled default values, ignoring the settings in any configuration file:
Each system variable has a default value, and you can set the variable at server startup by using options on the command line or using a configuration file, and the value of the system variable can be referenced in an expression. you can also view the value of the system variable used by the server.
Within the mysql client, you can use this command to view only the value of the variable, with no other startup options:
SHOW GLOBAL VARIABLES
For more information about server system variables, see the MySQL reference Manual:
Http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html .
1) dynamic system variables
MySQL maintains two scopes that contain system variables. The GLOBAL variable affects the overall operation of the server. The SESSION variable affects its operation on a single client connection. Variables exist in either scope or in both scopes.
Examples of variables and their scopes include:
Global only: key_buffer_size, query_cache_size
Global and session: sort_buffer_size, max_join_size
Session only: timestamp, error_count
When changing the value of a quantity, the following points apply:
No special permissions are required to set session variables, but clients can only change their own session variables, not those of any other client.
LOCAL and @ @ local are synonyms for SESSION and @ @ session.
If you do not specify GLOBAL or SESSION, SET changes the session variable when the session variable exists, and an error occurs when the session variable does not exist.
2) display dynamic system variables
List all available variables and their values:
SHOW [GLOBAL | SESSION] VARIABLES
List specific variable values:
Mysql > SHOW VARIABLES LIKE 'bulk%'
+-+ +
| | Variable_name | Value |
+-+ +
| | bulk_insert_buffer_size | 8388608 | |
+-+ +
Set a new value and list:
Mysql > SET bulk_insert_buffer_size=4000000
Mysql > SHOW VARIABLES LIKE 'bulk%'
+-+ +
| | Variable_name | Value |
+-+ +
| | bulk_insert_buffer_size | 4000000 | |
+-+ +
The SHOW VARIABLE session example uses' bulk%' to find variables that are used to set the buffer size slide, but you can enter any variable using the entire variable name, or you can enter a partial variable name and percentage sign (%) wildcard.
A specific variable type must be set as follows:
²uses string values for variables with string types such as CHAR or VARCHAR.
²uses numeric values for variables that have numeric types such as INT or DECIMAL.
²sets variables of type Boolean (BOOL or BOOLEAN) to 0, 1, ON, or OFF. (if you set a Boolean variable on the command line or in a configuration file, use a numeric value. )
²sets a variable of the enumerated type to one of the available variable values, but it can also be set to a number corresponding to the desired enumeration value. For enumerated server variables, the first enumerated value corresponds to 0. This is different from the ENUM column, where the first enumerated value corresponds to 1.
For more information about dynamic server variables, see the MySQL reference Manual:
Http://dev.mysql.com/doc/refman/5.6/en/dynamic-system-variables.html .
3) structured system variables
MySQL supports a structured variable type that specifies parameters that control key buffer operations. Key buffer structured variables have the following components:
Key_buffer_size
Key_cache_block_size
Key_cache_division_limit
Key_cache_age_threshold
To reference a component of a structured variable instance, use a compound name:
Instance_name.component_name format
Example:
Hot_cache.key_buffer_size
Hot_cache.key_cache_block_size
Cold_cache.key_cache_block_size
For more information about structured system variables, see the MySQL reference Manual:
Http://dev.mysql.com/doc/refman/5.6/en/structured-system-variables.html .
4) Server status variable
Use SHOW STATUS statements to evaluate the health of the system.
Choose from two categories (similar to dynamic variables):
LOCAL is synonymous with SESSION. If there is no modifier, the default value is SESSION.
Mysql > SHOW GLOBAL STATUS
+-+ +
| | Variable_name | Value |
+-+ +
| | Aborted_clients | 0 | |
| | Aborted_connects | 0 | |
| | Binlog_cache_disk_use | 0 | |
| | Bytes_received | 169 | |
| | Bytes_sent | 331 |
| | Com_admin_commands | 0 | |
...
Some state variables have only one global value. The values of GLOBAL and SESSION are the same for these state variables.
For more information about server status variables, see the MySQL reference Manual:
Http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html .
1.3. SQL mode
Configure a variety of server operation characteristics by setting SQL mode, specify MySQL tolerance for accepting input data, set compatibility with other database systems, control query processing (enable or disable behavior related to SQL compliance), override SQL's "empty" default mode (null mode does not enable restriction or compliance behavior).
The SQL schema consists of optional values that control some aspects of query processing. Once the appropriate SQL mode is set, the client can exercise some control over the following items:
²input data: the SQL schema can be used to indicate the server's tolerance for accepting input data.
²standard SQL compliance: the SQL mode can be used to enable or disable behaviors related to standard SQL compliance.
²compatibility: the SQL schema can be used to improve compatibility with other database systems.
The default SQL mode is NO_ENGINE_SUBSTITUTION, and the default profile adds STRICT_TRANS_TABLES.
1) set SQL mode
²is set at startup from the command line:
Shell > mysqld-- sql-mode=
²is set in the configuration file:
[mysqld]
Sql-mode=IGNORE_SPACE
²SET statement
In mysql, after startup:
SET [SESSION | GLOBAL] sql_mode=
Example:
Set the SQL mode with a single mode value:
SET sql_mode = ANSI_QUOTES
SET sql_mode = 'TRADITIONAL'
Set the SQL schema with multiple schema names:
Sql_mode = 'IGNORE_SPACE,ANSI_QUOTES,NO_ENGINE_SUBSTITUTION'
Use the SELECT statement to check the current sql_mode settings:
SELECT @ @ sql_mode
Clear the current SQL mode:
SET sql_mode=''
Individual clients can configure SQL mode according to their own requirements, but you can also use the-- sql-mode option to set the default SQL mode when the server starts. You may need to do this if the server is running in a mode that is cautious about accepting invalid data or creating MySQL user accounts.
If there is no modifier, SET changes the session SQL mode. The SET statement can be called with an empty string or one or more schema names separated by commas. If the value is empty or contains multiple schema names, you must enclose the value in quotation marks. Quotation marks are optional if the value contains a schema name. SQL mode values are not case sensitive.
2) commonly used SQL modes
STRICT_TRANS_TABLES, STRICT_ALL_TABLES: without these patterns, MySQL will accept values that are missing, out of range, or malformed. Strict Mode is set for the transaction table when STRICT_TRANS_TABLES is enabled; it can also be enabled in the default my.cnf file. Strict mode is set for all tables when STRICT_ALL_TABLES is enabled.
TRADITIONAL: enabling this SQL mode imposes restrictions on input data values similar to those of other database servers. In this mode, use the GRANT statement to create a user that requires a specified password.
IGNORE_SPACE: by default, a function with no space between the function name and the following parentheses must be called. When this mode is enabled, such spaces are allowed and the function name is made a reserved word.
ERROR_FOR_DIVISION_BY_ZERO: by default, a divisor of 00:00 produces the result NULL. When inserting data with this mode enabled, a divisor of zero results in a warning and an error in strict mode.
ANSI: using this combination mode will make the MySQL server more "ANSI-like". That is, this pattern supports behaviors that are more like standard SQL, such as ANSI_QUOTES and PIPES_AS_CONCAT.
NO_ENGINE_SUBSTITUTION: if you specify a storage engine that is not available when creating or changing the table, MySQL replaces the default storage engine unless this mode is enabled. This is the default SQL mode.
1.4. Log file
MySQL uses different log files to record server activity and record information about the SQL statements executed by the server:
²error log: diagnostic information related to startup, shutdown, and abnormal conditions
²general query log: all statements received by the server from the client
²slow query log: queries that need to be executed for a long time
²binary log: statements that modify data
²audit log: enterprise version of policy-based audit
These logs can be used to evaluate the operational status of the server, for data recovery after a crash, for replication, to help determine slow queries, and for security and compliance. None of these logs are enabled by default (except for error logs in Windows). It is important to understand that the size of log files, especially regular query logs, can grow to considerable size.
For more information about log files, see the MySQL reference Manual:
Http://dev.mysql.com/doc/refman/5.6/en/server-logs.html and
Http://dev.mysql.com/doc/refman/5.6/en/mysql-enterprise-audit.html
1) list of log file usage
The server creates all log files in the data directory; if no other pathname is set, the server sets the file name to the current hostname. These log files can be enabled by using the corresponding options when starting the server (on the command line, or in the configuration file (without a prefix).
Error log: set-- log-error= to log errors to the specified file. The mysqld_safe script creates an error log and redirects its output to the error log when the server is started.
General query log: set-- general_log_file= to record the query. The global general_log and general_log_file server variables provide run-time control over regular query logs. Set general_log to 0 (or OFF) to disable the log and set to 1 (or ON) to enable the log.
Slow query logs: set-- slow_query_log_file= to provide run-time control over slow query logs. Set slow_query_log to 0 to disable the log and 1 to enable the log. If the log file is open, close it, and then open the new file.
Binary logging: set-- log-bin to enable binary logging. The server uses this option value as the base name; when creating a new log file, add an ascending numeric suffix to the base name. These log files are stored in binary format instead of text format.
Audit log: the audit log is provided as an Enterprise plug-in; when loaded, it can be used to log events to the file specified by the audit_log_file option. The audit process continues to write to the audit log until the plug-in is removed or the audit is turned off through the audit_log_policy=NONE option setting. Use audit_log=FORCE_PLUS_PERMANENT as an option when the server starts to prevent the plug-in from being deleted.
2) binary logging
The binary log contains "events" that describe database changes, such as creating a database or changing table data. The binary log also contains events for statements that may make changes (for example, DELETE with no matching rows). The log also contains information about the time taken by each update statement. Binary logs have two important uses: replication and data recovery.
MySQL uses log shipping replication solutions. When using the log shipping system, you can store all data changes that occur on the primary system in the binary log, and then perform the changes based on the received log files by retrieving them from the system. The log file can be downloaded and executed in real time; that is, whenever a log file event is generated, it is sent to the connected slave system for execution. Due to delays in network propagation, it may take a few seconds to a few minutes (at worst) for the system to receive updates. Ideally, the delay would be less than a second.
The binary log rotates when one of the following events occurs:
Restart the MySQL server.
L reaches the maximum allowed size (max_binlog_size).
L issued the FLUSH LOGS SQL command.
Binary logs are independent of the storage engine. MySQL replication works regardless of which storage engine is used (that is, InnoDB or MyISAM).
3) binary logging format
Statement-based binary logging:
L contains the actual SQL statement
L includes DDL (CREATE, DROP, etc.) and DML (UPDATE, DELETE, etc.) statements
L relatively small files save disk space and network bandwidth
Not all copied statements will be replayed correctly on the remote computer
L requires that the tables and columns copied from the master system and slave system are exactly the same (or meet multiple restrictions)
Line-based binary logging:
L indicates the impact on a single table row
L replay all statements correctly, even for changes caused by features that are not copied correctly when statement-based logging is used
Format as follows:
SET [GLOBAL | SESSION] BINLOG_FORMAT= [row | statement | mixed | default]
Note: using the mixed option allows MySQL to choose the format that best suits a single event. MySQL typically uses statement-based binary logs, but can revert to row-based replication when needed.
4) query binary log files
Use the SHOW BINARY LOGS statement to accomplish the following tasks:
# list the current log file and file size
Mysql > SHOW BINARY LOGS
+-+ +
| | Log_name | File_size |
+-+ +
| | binlog.000015 | 724935 | |
| | binlog.000016 | 733481 | |
+-+ +
Use the SHOW MASTER STATUS statement to accomplish the following tasks:
# display the main status of the next event
Mysql > SHOW MASTER STATUS
+-+
| | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | |
+-+
| | binlog.000016 | 733481 | world_innodb | manual,mysql | |
+-+
Statements are stored in binary logs in the form of "events" that describe database modifications. To determine the event, you must get the binary log file name and byte offset (that is, location). For example, the log file binlog.000016, location 733481, determines the last event in the slide.
The SHOW MASTER STATUS command requires SUPER or REPLICATION CLIENT permissions.
5) View the contents of binary log
Binary logs cannot be viewed using a plain text viewer and are stored in a compact binary format. Using the mysqlbinlog utility, you can convert binary logs to SQL text format and view the data in standard output:
Shell > mysqlbinlog host-bin.000001 host-bin.000002
You can also redirect the output to more:
Shell > mysqlbinlog host-bin.000001 | more
Execute the mysqlbinlog program from the command line, specifying the log to be viewed as a parameter. This program has several options that provide features such as extracting events based on time or file offset. You can view all options with the-- help flag. In the mysqlbinlog output, the event is preceded by a header comment that provides relevant information:
# at 141
# 100309 9:28:36 server id 123 end_log_pos 245
Query thread_id=3350 exec_time=11 error_code=0
If you create a binary log using statement-based logging, and then run mysqlbinlog-- database=test to create a readable file, the server filters out statements that are not associated with the test database:
INSERT INTO test.t1 (I) VALUES (100)
-
| | USE test; |
| | INSERT INTO test.t1 (I) VALUES (101); | |
| | INSERT INTO T1 (I) VALUES; | |
| | INSERT INTO db2.t2 (j) VALUES (201); |
-
USE db2
INSERT INTO db2.t2 (j) VALUES (202)
Because there is no default database, the first INSERT statement is not included. The output is the three INSERT statements that follow USE test, not the INSERT statements that follow USE db2.
6) delete binary log
By default, old log files are not automatically deleted.
a. Delete the log based on the time it exists:
SET GLOBAL expire_logs_days = 7
... Or...
PURGE BINARY LOGS BEFORE now ()-INTERVAL 3 day
b. Delete the log based on the file name:
PURGE BINARY LOGS TO 'mysql-bin.000010'
c. To automatically delete any binary logs that have existed for more than a specified number of days during binary log rotation, use the expire_logs_days setting.
You can also configure expire_logs_days in the configuration file:
[mysqld]
Expire_logs_days=7
7) configure enterprise audit
Enterprise auditing is achieved by using the audit_log server plug-in, which is provided with the enterprise version subscription. When enterprise auditing is enabled, an audit record of server activity is generated in the log file, depending on the policy, and may include:
A record of errors that occurred on ²on the system
²client connection and disconnection time
Actions performed by ²client during connection
Databases and tables accessed by ²client
a. Install the audit_log plug-in
To install the audit_log plug-in, use the INSTALL PLUGIN syntax, as shown in the following example:
INSTALL PLUGIN audit_log SONAME 'audit_log.so'
Alternatively, you can set the plugin-load option when the server starts:
[mysqld]
Plugin-load=audit_log.so
By default, loading the plug-in enables logging. Set the option audit-log to OFF to disable logging. To prevent the plug-in from being deleted at run time, set the following options:
Audit-log=FORCE_PLUS_PERMANENT
The log file is named audit.log and is located in the server data directory by default. To change the name or location of the file, set the audit_log_file system variable when the server starts.
b. Logging policy
Policy-based logging is set through the audit_log_policy option. The logging options provided are ALL, NONE, LOGINS or QUERIES. The default is ALL.
To balance compliance and performance, use the audit_log_strategy option to choose between SYNCHRONOUS, ASYNCHRONOUS, SEMISYNCHRONOUS, and PERFORMANCE. If audit_log_rotate_on_size is set to a number greater than 0, log files are rotated when the log file size exceeds that number of 4 KB blocks.
For more information about configuring corporate auditing, see the MySQL reference Manual:
Http://dev.mysql.com/doc/refman/5.6/en/audit-log-plugin-options-variables.html
c. Audit log file
The audit log file is written in the form of XML and encoded by UTF-8. The root element is zero. The closing tag of the root element is written when the plug-in terminates. The tag is not in the file while the audit log plug-in is active. Each audit entry is an element:
The TIMESTAMP of each audit record is in UTC format.
The NAME attribute represents the event type. For example, "Connect" indicates a login event, "Quit" indicates that the client is disconnected, and "Shutdown" indicates that the server is down. "Audit" and "NoAudit" indicate the point where the audit starts and stops.
The STATUS property provides the command status. This is the same as the Code value displayed by the MySQL command SHOW ERRORS. Some properties appear only in specific event types. For example, the "Connect" event includes properties such as HOST, DB, IP, and USER, and the "Query" event includes the SQLTEXT property.
The above is all the contents of the article "how to configure the server for MySQL". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.