Curso de MariaDB Desde la Consola/my.cnf
Ir a la navegación
Ir a la búsqueda
- /etc/my.cnf
- /etc/my.cnf.d/server.cnf
- /etc/my.cnf.d/client.cnf
- /etc/my.cnf.d/my-sql-clients.cnf
- /etc/my.cnf.d/auth_pam.cnf
- /etc/my.cnf.d/ha_federatedx.cnf
- /etc/my.cnf.d/query_response_time.cnf
- /etc/my.cnf.d/auth_socket.cnf
- /etc/my.cnf.d/handlersocket.cnf
- /etc/my.cnf.d/semisync_master.cnf
- /etc/my.cnf.d/locales.cnf
- /etc/my.cnf.d/semisync_slave.cnf
- /etc/my.cnf.d/feedback.cnf
- /etc/my.cnf.d/metadata_lock_info.cnf
- /etc/my.cnf.d/server_audit.cnf
- /etc/my.cnf.d/ha_archive.cnf
- /etc/my.cnf.d/ha_blackhole.cnf
- /etc/my.cnf.d/sql_errlog.cnf
- /etc/my.cnf.d/sql_errlog.cnf
my.cnf
1 [root@Pridd etc]# cat /etc/my.cnf
2 # A generic my.cnf file based on /usr/share/mysql/my-medium.cnf
3 #
4 # This is for a system with little memory (32M - 64M) where MySQL plays
5 # an important part, or systems up to 128M where MySQL is used together with
6 # other programs (such as a web server)
7 #
8
9 # The following options will be passed to all MySQL clients
10 [client]
11 user = root
12 #password = your_password
13 port = 3306
14 socket = /var/lib/mysql/mysql.sock
15
16 # Here follows entries for some specific programs
17
18 # The MySQL server
19 [mysqld]
20 user = mysql
21 datadir = /var/lib/mysql
22 port = 3306
23 socket = /var/lib/mysql/mysql.sock
24 pid-file = /var/run/mysqld/mysqld.pid
25 skip-external-locking
26 key_buffer = 16M
27 max_allowed_packet = 32M
28 table_cache = 64
29 sort_buffer_size = 512K
30 net_buffer_length = 8K
31 read_buffer_size = 256K
32 read_rnd_buffer_size = 512K
33 myisam_sort_buffer_size = 8M
34 default-storage-engine = InnoDB
35 collation_server = utf8_unicode_ci
36 character_set_server = utf8
37
38 # plugins
39 plugin_dir=/usr/lib64/mysql/plugin
40
41 # http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
42 ;rpl_semi_sync_master=semisync_master.so
43 ;rpl_semi_sync_slave=semisync_slave.so
44
45 # Others options for Semisynchronous Replication
46 ;rpl_semi_sync_master_enabled=1
47 ;rpl_semi_sync_master_timeout=10
48 ;rpl_semi_sync_slave_enabled=1
49
50 # "Don't" listen on a TCP/IP port at all. This can be a security enhancement,
51 # if all processes that need to connect to mysqld run on the same host.
52 # All interaction with mysqld must be made via Unix sockets or named pipes.
53 # Note that using this option without enabling named pipes on Windows
54 # (via the "enable-named-pipe" option) will render mysqld useless!
55 #
56 skip-networking
57
58 # Disabling symbolic-links is recommended to prevent assorted security risks
59 symbolic-links=0
60
61 # Replication Master Server (default)
62 # binary logging is required for replication
63 #log-bin=mysql-bin
64
65 # required unique id between 1 and 2^32 - 1
66 # defaults to 1 if master-host is not set
67 # but will not function as a master if omitted
68 server-id = 1
69
70 # Replication Slave (comment out master section to use this)
71 #
72 # To configure this host as a replication slave, you can choose between
73 # two methods :
74 #
75 # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
76 # the syntax is:
77 #
78 # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
79 # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
80 #
81 # where you replace <host>, <user>, <password> by quoted strings and
82 # <port> by the "master's" port number (3306 by default).
83 #
84 # Example:
85 #
86 # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
87 # MASTER_USER='joe', MASTER_PASSWORD='secret';
88 #
89 # OR
90 #
91 # 2) Set the variables below. However, in case you choose this method, then
92 # start replication for the first time (even unsuccessfully, for example
93 # if you mistyped the password in master-password and the slave fails to
94 # connect), the slave will create a master.info file, and any later
95 # change in this file to the "variables'" values below will be ignored and
96 # overridden by the content of the master.info file, unless you shutdown
97 # the slave server, delete master.info and restart the slaver server.
98 # For that reason, you may want to leave the lines below untouched
99 # (commented) and instead use CHANGE MASTER TO (see above)
100 #
101 # required unique id between 2 and 2^32 - 1
102 # (and different from the master)
103 # defaults to 2 if master-host is set
104 # but will not function as a slave if omitted
105 #server-id = 2
106 #
107 # The replication master for this slave - required
108 #master-host = <hostname>
109 #
110 # The username the slave will use for authentication when connecting
111 # to the master - required
112 #master-user = <username>
113 #
114 # The password the slave will authenticate with when connecting to
115 # the master - required
116 #master-password = <password>
117 #
118 # The port the master is listening on.
119 # optional - defaults to 3306
120 #master-port = <port>
121 #
122 # binary logging - not required for slaves, but recommended
123 #log-bin=mysql-bin
124
125 # Point the following paths to different dedicated disks
126 tmpdir = /var/tmp
127 #log-update = /path-to-dedicated-directory/hostname
128
129 # Uncomment the following if you are using BDB tables
130 #bdb_cache_size = 4M
131 #bdb_max_lock = 10000
132
133 # Uncomment the following if you are using InnoDB tables
134 innodb_data_home_dir = /var/lib/mysql/
135 innodb_data_file_path = ibdata1:10M:autoextend
136 innodb_log_group_home_dir = /var/lib/mysql/
137 innodb_log_arch_dir = /var/lib/mysql/
138 # You can set .._buffer_pool_size up to 50 - 80 %
139 # of RAM but beware of setting memory usage too high
140 innodb_buffer_pool_size = 16M
141 innodb_additional_mem_pool_size = 2M
142 # Set .._log_file_size to 25 % of buffer pool size
143 innodb_log_file_size = 5M
144 innodb_log_buffer_size = 8M
145 innodb_flush_log_at_trx_commit = 1
146 innodb_lock_wait_timeout = 50
147 innodb_file_per_table
148
149 #bind-address=192.168.100.1
150
151 [mysqldump]
152 quick
153 max_allowed_packet = 16M
154
155 [mysql]
156 no-auto-rehash
157 # Remove the next comment character if you are not familiar with SQL
158 #safe-updates
159 default-character-set = utf8
160
161 [isamchk]
162 key_buffer = 20M
163 sort_buffer_size = 20M
164 read_buffer = 2M
165 write_buffer = 2M
166
167 [myisamchk]
168 key_buffer = 20M
169 sort_buffer_size = 20M
170 read_buffer = 2M
171 write_buffer = 2M
172
173 [mysqlhotcopy]
174 interactive-timeout
175
176 [mysql.server]
177 user=mysql
178 basedir=/usr
179
180 [mysqld_safe]
181 log-error=/var/log/mysqld/mysqld.log
182 pid-file=/var/run/mysqld/mysqld.pid
183
184 !includedir /etc/my.cnf.d
server.cnf
1 [rrc@myrddin ~]$ cat /etc/my.cnf.d/server.cnf
2 #
3 # These groups are read by MariaDB server.
4 # Use it for options that only the server (but not clients) should see
5 #
6 # See the examples of server my.cnf files in /usr/share/mysql/
7 #
8
9 # this is read by the standalone daemon and embedded servers
10 [server]
11
12 # this is only for the mysqld standalone daemon
13 [mysqld]
14
15 # this is only for embedded server
16 [embedded]
17
18 # This group is only read by MariaDB servers, not by MySQL.
19 # If you use the same .cnf file for MySQL and MariaDB,
20 # you can put MariaDB-only options here
21 [mariadb]
22
23 # This group is only read by MariaDB-10.0 servers.
24 # If you use the same .cnf file for MariaDB of different versions,
25 # use this group for options that older servers "don't" understand
26 [mariadb-10.0]
client.cnf
1 [rrc@myrddin ~]$ cat /etc/my.cnf.d/client.cnf
2 #
3 # These two groups are read by the client library
4 # Use it for options that affect all clients, but not the server
5 #
6
7 [client]
8
9 # This group is not read by mysql client library,
10 # If you use the same .cnf file for MySQL and MariaDB,
11 # use it for MariaDB-only client options
12 [client-mariadb]
mysql-clients.cnf
1 [rrc@myrddin ~]$ cat /etc/my.cnf.d/mysql-clients.cnf
2 #
3 # These groups are read by MariaDB command-line tools
4 # Use it for options that affect only one utility
5 #
6
7 [mysql]
8
9 [mysql_upgrade]
10
11 [mysqladmin]
12
13 [mysqlbinlog]
14
15 [mysqlcheck]
16
17 [mysqldump]
18
19 [mysqlimport]
20
21 [mysqlshow]
22
23 [mysqlslap]
auth_pam.cnf
1 [root@Pridd my.cnf.d]# cat auth_pam.cnf
2 [mariadb]
3
4 plugin-load-add=auth_pam.so
ha_federatedx.cnf
1 [root@Pridd my.cnf.d]# cat ha_federatedx.cnf
2 [mariadb]
3
4 plugin-load-add=ha_federatedx.so
5
6 # activate the federated storage engine
7 federated
query_response_time.cnf
1 [root@Pridd my.cnf.d]# cat query_response_time.cnf
2 [mariadb]
3
4 plugin-load-add=query_response_time.so
auth_socket.cnf
1 [root@Pridd my.cnf.d]# cat auth_socket.cnf
2 [mariadb]
3
4 plugin-load-add=auth_socket.so
handlersocket.cnf
1 [root@Pridd my.cnf.d]# cat handlersocket.cnf
2 [mariadb]
3
4 plugin-load-add=handlersocket.so
semisync_master.cnf
1 [root@Pridd my.cnf.d]# cat semisync_master.cnf
2 [mariadb]
3
4 plugin-load-add=semisync_master.so
locales.cnf
1 [root@Pridd my.cnf.d]# cat locales.cnf
2 [mariadb]
3
4 plugin-load-add=locales.so
semisync_slave.cnf
1 [root@Pridd my.cnf.d]# cat semisync_slave.cnf
2 [mariadb]
3
4 plugin-load-add=semisync_slave.so
feedback.cnf
1 [root@Pridd my.cnf.d]# cat feedback.cnf
2 [mariadb]
3
4 plugin-load-add=feedback.so
metadata_lock_info.cnf
1 [root@Pridd my.cnf.d]# cat metadata_lock_info.cnf
2 [mariadb]
3
4 plugin-load-add=metadata_lock_info.so
server_audit.cnf
1 [root@Pridd my.cnf.d]# cat server_audit.cnf
2 [mariadb]
3
4 plugin-load-add=server_audit.so
ha_archive.cnf
1 [root@Pridd my.cnf.d]# cat ha_archive.cnf
2 [mariadb]
3
4 plugin-load-add=ha_archive.so
ha_blackhole.cnf
1 [root@Pridd my.cnf.d]# cat ha_blackhole.cnf
2 [mariadb]
3
4 plugin-load-add=ha_blackhole.so
query_cache_info.cnf
1 [root@Pridd my.cnf.d]# cat query_cache_info.cnf
2 [mariadb]
3
4 plugin-load-add=query_cache_info.so
sql_errlog.cnf
1 [root@Pridd my.cnf.d]# cat sql_errlog.cnf
2 [mariadb]
3
4 plugin-load-add=sql_errlog.so