Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL 5.5How to set up a profile

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to set up the configuration file of MySQL 5.5. it has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

In the MySQL database, there can be no configuration file, in which case MySQL installs the default parameter settings at compile time to start the instance

Use the following command to see where the MYSQL database instance looks for configuration files when it starts

[root@localhost test] # mysql-- help | grep my.cnf

Order of preference, my.cnf, $MYSQL_TCP_PORT

/ etc/my.cnf / etc/mysql/my.cnf / usr/etc/my.cnf ~ / .my.cnf

There are startup parameters and system parameters in MySQL. Startup parameters cannot be queried through show variables and can be found in the options of mysqld.

For example, there are Startup Options Used with Binary Logging and System Variables Used with Binary Logging parameters for binary logs.

[root@localhost log] # mysqld-- verbose-- help > 02.txt

[root@localhost log] # vim 02.txt

..

-- binlog-do-db=name Tells the master it should log updates for the specified

Database, and exclude all others not explicitly

Mentioned.

..

[root@localhost log] # vim / etc/my.cnf

..

# log

Server-id = 10000

Log-bin = / log/binlog/mysql-bin

Binlog_format = MIXED

Binlog-do-db = test

[root@localhost data] # vim / etc/my.cnf

[client]

Port = 3306

Socket=/mysql_data/70005/mysql.sock

# Mysql server

[mysqld]

Port = 3306

User = mysql

Socket=/mysql_data/70005/mysql.sock

Pid-file = / mysql_data/70005/mysqld.pid

Basedir = / software

Datadir = / data

# tmpdir =

Open_files_limit = 10240

Max_connections = 500,

Max_connect_errors = 100000

Sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Wait_timeout = 100

# Cache

Table_open_cache = 400

Thread_cache_size = 300

# Buffer

Max_allowed_packet = 256m

Max_heap_table_size = 256m

Net_buffer_length = 8K

Sort_buffer_size = 4m

Join_buffer_size = 2m

Read_buffer_size = 2m

Read_rnd_buffer_size = 16m

# query_cache_size = 32m

# Log

Server-id = 1

Log-bin = / log/binlog/mysql-bin

Sync_binlog = 2

Binlog_cache_size = 32m

Max_binlog_cache_size = 512m

Max_binlog_size = 512m

Binlog_format = MIXED

# binlog_cache_use = 100

# binlog_cache_disk_use = 50

Log_output = FILE

Log_error = / log/err.log

Slow_query_log = 1

Slow_query_log_file = / log/slow_query.log

Long_query_time = 10

Log-short-format = 0

Log_slow_admin_statements = 0

Log_queries_not_using_indexes = 0

# log_throttle_queries_not_using_indexes = 0

Log_slow_slave_statements = 0

General_log = 0

General_log_file = / log/general_query.log

# InnoDB

Innodb_data_file_path = ibdata1:12M:autoextend:max:100G

# innodb_data_file_path = / ibdata/ibdata1:12M:autoextend:max:100G

Innodb_data_home_dir = / ibdata

Innodb_file_per_table = 1

Innodb_log_group_home_dir = / log/innodb

# innodb_log_file_size = 256m

# innodb_log_files_in_group = 3

Innodb_log_buffer_size = 8m

Innodb_buffer_pool_size = 100m

# InnoDB undo _ _ Mysql 5.6 or higher

# innodb_undo_directory = / log/undo

# innodb_undo_tablespaces = 2

# innodb_undo_logs = 200

Innodb_fast_shutdown = 1

Innodb_flush_log_at_trx_commit = 1

Innodb_buffer_pool_instances = 5

# MyISAM

# skip-external-locking

# key_buffer_size = 128m

# myisam_sort_buffer_size = 64m

# Character set

# character_set_server = gbk

# collation_server = gbk_bin

# Federated storage engine

Federated

# Transaction

Init_connect='SET autocommit=0'

[mysql]

No-auto-rehash

Default-character-set = gbk

[mysqldump]

Quick

Max_allowed_packet = 16m

[myisamchk]

# key_buffer_size = 256m

# sort_buffer_size = 256m

# read_buffer = 2m

# write_buffer = 2m

[mysqlhotcopy]

# interactive-timeout

Thank you for reading this article carefully. I hope the article "how to configure MySQL 5.5" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report