<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mysql归档 - Liao&#039;s blog</title>
	<atom:link href="https://www.laobaiblog.top/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.laobaiblog.top/category/mysql/</link>
	<description>路漫漫其修远兮，吾将上下而求索</description>
	<lastBuildDate>Thu, 02 Jan 2025 06:35:51 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.laobaiblog.top/wp-content/uploads/2022/01/cropped-tyuu-32x32.png</url>
	<title>mysql归档 - Liao&#039;s blog</title>
	<link>https://www.laobaiblog.top/category/mysql/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Windows下安装MySQL5.7</title>
		<link>https://www.laobaiblog.top/2022/02/09/windows%e4%b8%8b%e5%ae%89%e8%a3%85mysql5-7/</link>
		
		<dc:creator><![CDATA[大白]]></dc:creator>
		<pubDate>Wed, 09 Feb 2022 02:25:28 +0000</pubDate>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[分享]]></category>
		<guid isPermaLink="false">https://www.laobaiblog.top/?p=119</guid>

					<description><![CDATA[<p>下载MySQL5.7 官网：https://dev.mysql.com/downloads/mysq &#8230;</p>
<p><a href="https://www.laobaiblog.top/2022/02/09/windows%e4%b8%8b%e5%ae%89%e8%a3%85mysql5-7/">Windows下安装MySQL5.7</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></description>
										<content:encoded><![CDATA[<h1>下载MySQL5.7</h1>
<p>官网：https://dev.mysql.com/downloads/mysql/</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_505db15a38d181f85b00d18f54569d3e.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_505db15a38d181f85b00d18f54569d3e.jpg" alt="" /></a></p>
<h1>解压安装</h1>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_293f8b2a27a4ca9670efbbf8b9561002.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_293f8b2a27a4ca9670efbbf8b9561002.jpg" alt="" /></a></p>
<h2>配置环境变量</h2>
<p>依次点击 “我的电脑”-“属性”-“高级系统设置”-“环境变量”。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_41a323e0691fa7892c254006bb2ad660.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_41a323e0691fa7892c254006bb2ad660.jpg" alt="" /></a></p>
<p>新建MYSQL_HOME，填入MySQL路径。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_332d8cc46ac5ba63d212be77b78d39ed.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_332d8cc46ac5ba63d212be77b78d39ed.jpg" alt="" /></a></p>
<p>编辑Path,在末尾加上<code>;%MYSQL_HOME%\bin</code>。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_e0d66d7e157d7d25f1d9b770dd4bdf9e.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_e0d66d7e157d7d25f1d9b770dd4bdf9e.jpg" alt="" /></a></p>
<h2>新建my.ini文件</h2>
<p>在MySQL安装目录下新建该文件编辑，填入以下参数</p>
<pre><code class="language-shell line-numbers">[mysqld]
# 端口
port = 3306
# 这个你自己的安装目录
basedir=D:\application\mysql5.7\mysql-5.7.35-winx64
datadir=D:\application\mysql5.7\mysql-5.7.35-winx64\data
max_connections=2000
character-set-server=utf8

# 数据库类型inndb支持事务
default-storage-engine=INNODB
sql_mode=STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
event_scheduler=ON
[mysql]
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_7035f764cc3fc8c880ed8bdd9585e002.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_7035f764cc3fc8c880ed8bdd9585e002.jpg" alt="" /></a></p>
<h2>启动MySQL5.7</h2>
<p>管理员角色打开cmd,进入<code>D:\application\mysql5.7\mysql-5.7.35-winx64</code>。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_e6cd329668285980ef89fc0ee4f996a1.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_e6cd329668285980ef89fc0ee4f996a1.jpg" alt="" /></a></p>
<p>输入<code>mysqld --install</code>,安装成功。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_3db3965ec81c0ca39185936bf9267386.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_3db3965ec81c0ca39185936bf9267386.jpg" alt="" /></a></p>
<p>再输入<code>mysqld --initialize-insecure --user=mysql</code>，执行命令后会在MySQL的安装目录下生成data目录并创建root用户。</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_2969dbb082a442d75d8d79b4184774fb.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_2969dbb082a442d75d8d79b4184774fb.jpg" alt="" /></a></p>
<p>启动MySQL服务，输入<code>net start mysql</code>，如果提示出现<strong>发生系统错误 2。</strong></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_8476bdf89d0f655e200b09a72ebe94a7.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_8476bdf89d0f655e200b09a72ebe94a7.jpg" alt="" /></a></p>
<p>输入<code>mysqld --remove</code>,再次输入<code>mysqld --install</code>即可</p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_940de05c4c25795e5493c5ab69a6c03f.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_940de05c4c25795e5493c5ab69a6c03f.jpg" alt="" /></a></p>
<h2>设置root密码</h2>
<p>第一次安装后，root没有密码直接登录即可</p>
<pre><code class="language-shell line-numbers">mysql -uroot -p
mysql&gt; use mysql;
mysql&gt; set password for root@localhost = password('123456');
#修改root密码
#mysql&gt; update user set authentication_string=password('your_new_password') where user='root';
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_0a95e7b0ab99c7675f2efc3ebc1240ab.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_0a95e7b0ab99c7675f2efc3ebc1240ab.jpg" alt="" /></a></p>
<h3>授权远程root登录</h3>
<pre><code class="language-shell line-numbers">mysql&gt; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
mysql&gt; FLUSH PRIVILEGES;
mysql&gt; exit;
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_f1c258cc61efdabb469294db7de3f140.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_f1c258cc61efdabb469294db7de3f140.jpg" alt="" /></a></p>
<h1>注意事项</h1>
<p>如果提示出现安装失败，缺少<strong>MYSQL安装丢失MSVCR-120.dll问题</strong>，官网下载dll<a class="wp-editor-md-post-content-link" href="https://www.microsoft.com/zh-CN/download/details.aspx?id=40784">补全工具</a>即可<br />
<a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_1478364f082774f4ff1c0585789776ca.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_1478364f082774f4ff1c0585789776ca.jpg" alt="" /></a></p>
<p><a href="https://www.laobaiblog.top/2022/02/09/windows%e4%b8%8b%e5%ae%89%e8%a3%85mysql5-7/">Windows下安装MySQL5.7</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Mysql查看数据库表容量大小示例</title>
		<link>https://www.laobaiblog.top/2022/02/07/mysql%e6%9f%a5%e7%9c%8b%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a1%a8%e5%ae%b9%e9%87%8f%e5%a4%a7%e5%b0%8f%e7%a4%ba%e4%be%8b/</link>
		
		<dc:creator><![CDATA[大白]]></dc:creator>
		<pubDate>Mon, 07 Feb 2022 07:49:17 +0000</pubDate>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[分享]]></category>
		<guid isPermaLink="false">https://www.laobaiblog.top/?p=101</guid>

					<description><![CDATA[<p>mysql笔记 引用地址 查看所有数据库容量大小 select table_schema as '数 &#8230;</p>
<p><a href="https://www.laobaiblog.top/2022/02/07/mysql%e6%9f%a5%e7%9c%8b%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a1%a8%e5%ae%b9%e9%87%8f%e5%a4%a7%e5%b0%8f%e7%a4%ba%e4%be%8b/">Mysql查看数据库表容量大小示例</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p><em>mysql笔记</em></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.jb51.net/article/169351.htm">引用地址</a></p>
<ul>
<li><strong>查看所有数据库容量大小</strong></li>
</ul>
<pre><code class="language-shell line-numbers">select 
table_schema as '数据库',
sum(table_rows) as '记录数',
sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',
sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'
from information_schema.tables
group by table_schema
order by sum(data_length) desc, sum(index_length) desc;
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_419c872404515b559657be68bb133db6.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_419c872404515b559657be68bb133db6.jpg" alt="" /></a></p>
<ul>
<li><strong>查看数据库各表容量大小</strong></li>
</ul>
<pre><code class="language-shell line-numbers">select 
table_schema as '数据库',
table_name as '表名',
table_rows as '记录数',
truncate(data_length/1024/1024, 2) as '数据容量(MB)',
truncate(index_length/1024/1024, 2) as '索引容量(MB)'
from information_schema.tables
order by data_length desc, index_length desc;
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_faba4afcf64f960e770bd589c185d7e4.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_faba4afcf64f960e770bd589c185d7e4.jpg" alt="" /></a></p>
<ul>
<li><strong>查看指定数据库容量大小</strong></li>
</ul>
<pre><code class="language-shell line-numbers">select 
table_schema as '数据库',
sum(table_rows) as '记录数',
sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',
sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'
from information_schema.tables
where table_schema='mysql';
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_b3669741e77cd5b0c5b2079126bd2ffe.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_b3669741e77cd5b0c5b2079126bd2ffe.jpg" alt="" /></a></p>
<ul>
<li><strong>查看指定数据库各表容量大小</strong></li>
</ul>
<pre><code class="language-shell line-numbers">select 
table_schema as '数据库',
table_name as '表名',
table_rows as '记录数',
truncate(data_length/1024/1024, 2) as '数据容量(MB)',
truncate(index_length/1024/1024, 2) as '索引容量(MB)'
from information_schema.tables
where table_schema='mysql'
order by data_length desc, index_length desc;
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_f8d61b538991f60880333a0b2ffde389.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/02/wp_editor_md_f8d61b538991f60880333a0b2ffde389.jpg" alt="" /></a></p>
<ul>
<li><strong>查看锁表及delete大容量表后整理数据空间</strong></li>
</ul>
<pre><code class="language-shell line-numbers">#查看当前锁定表的状态，其中 In_use 表示表当前是否被锁定。如果 In_use 的值大于 0，说明该表被锁定了
SHOW OPEN TABLES WHERE In_use &gt;0;
#这个命令可以显示当前 MySQL 数据库的所有进程以及它们的状态。如果一个表被锁定了，会有一个Waiting for table metadata
SHOW FULL PROCESSLIST;
#使用第二个命令查看当前的锁定信息后，可以看到该表被哪些进程锁定了。使用上面的命令可以杀掉当前锁定该表的进程
KILL ***;
#释放表锁
UNLOCK TABLES;
#使用OPTIMIZE TABLE可以执行以下操作：
#重建表的数据文件
#减少碎片，使数据存储更加紧凑
#可能会回收未使用的空间，并将其返还给操作系统
#对于InnoDB表，执行OPTIMIZE TABLE通常会重新构建表，以减少页面的碎片和压缩数据页
OPTIMIZE TABLE table_name
</code></pre>
<p><a href="https://www.laobaiblog.top/2022/02/07/mysql%e6%9f%a5%e7%9c%8b%e6%95%b0%e6%8d%ae%e5%ba%93%e8%a1%a8%e5%ae%b9%e9%87%8f%e5%a4%a7%e5%b0%8f%e7%a4%ba%e4%be%8b/">Mysql查看数据库表容量大小示例</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Mysql5.7/8优化配置My.cnf</title>
		<link>https://www.laobaiblog.top/2022/01/24/mysql5-7-8%e4%bc%98%e5%8c%96%e9%85%8d%e7%bd%aemy-cnf/</link>
		
		<dc:creator><![CDATA[大白]]></dc:creator>
		<pubDate>Mon, 24 Jan 2022 09:35:13 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">https://www.laobaiblog.top/?p=91</guid>

					<description><![CDATA[<p>具体配置看个人需求 Mysql5.7 [mysql] port = 3306 default-cha &#8230;</p>
<p><a href="https://www.laobaiblog.top/2022/01/24/mysql5-7-8%e4%bc%98%e5%8c%96%e9%85%8d%e7%bd%aemy-cnf/">Mysql5.7/8优化配置My.cnf</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p><em>具体配置看个人需求</em></p>
<h1>Mysql5.7</h1>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/01/wp_editor_md_e7f47e3f9f3adf990b98f976e56c1b09.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/01/wp_editor_md_e7f47e3f9f3adf990b98f976e56c1b09.jpg" alt="" /></a></p>
<pre><code class="language-shell line-numbers">[mysql]
port = 3306
default-character-set=utf8mb4
#socket=/data/mysql/mysql.sock

[mysqld]
##########################
# summary
##########################
#user = mysql
bind-address = 0.0.0.0
port = 3306
#basedir=/data/mysql
#datadir=/data/mysql/data
#socket=/data/mysql/mysql.sock
#tmpdir = /tmp
#pid-file=/tmp/mysqld.pid
#skip-grant-tables
#skip-networking
# 默认安装后error_log,slow_log 日志时间戳默认为UTC
log_timestamps=SYSTEM
explicit_defaults_for_timestamp=1
lower_case_table_names=1
table_open_cache = 8000

##########################
# time out
##########################
connect_timeout = 20
wait_timeout = 600

##########################
# connection
##########################
max_connections = 2000
max_user_connections = 1900
max_connect_errors = 100000
max_allowed_packet = 1G

##########################
# character set
##########################
character-set-server = utf8mb4
collation-server = utf8mb4_bin

##########################
# log bin
##########################
#server-id = 1
#log_bin = mysql-bin
# ROW、STATEMENT、MIXED
#binlog_format = row
#sync_binlog = 1
#expire_logs_days = 7
#binlog_cache_size = 128m
#max_binlog_cache_size = 512m
#max_binlog_size = 256M
#master_info_repository=TABLE
#relay_log_info_repository=TABLE
#log_slave_updates=ON
#binlog_checksum=none

#binlog_ignore_db=information_schema
#binlog_ignore_db=mysql
#binlog_ignore_db=performation_schema
#binlog_ignore_db=sys
#binlog_do_do=
#replicate_ignore_db=information_schema
#replicate_ignore_db=mysql
#replicate_ignore_db=performance_schema
#replicate_ignore_db=sys
#replicate_do_db=

##########################
# gtid
##########################
#gtid_mode = on
#enforce_gtid_consistency = on

##########################
# slave parallel
##########################
#slave_net_timeout=60
#slave_parallel_type=LOGICAL_CLOCK
#slave_parallel_workers=4

##########################
# log relay
##########################
#relay_log = mysql-relay-bin
#relay_log_purge = on
#relay_log_recovery = on
#max_relay_log_size = 1G

##########################
# log error
##########################
log_error=/data/mysql/logs/mysqld_error.log

##########################
# log slow
##########################
slow_query_log = on
slow_query_log_file = /data/mysql/logs/mysqld_slow.log
long_query_time = 2
log_queries_not_using_indexes = on

##########################
# log general
##########################
general_log = on
general_log_file = /data/mysql/logs/mysqld_gener.log


##########################
# thread pool
##########################
#thread_handling=pool-of-threads
#thread_handling=one-thread-per-connection
#thread_pool_oversubscribe=8 

##########################
# innodb
##########################
#innodb_file_per_table=1
#innodb_log_file_size=1024M
#innodb_log_buffer_size=64M


##########################
# password policy
# after init 
##########################
#validate_password_policy=0
#validate_password_length=4         
#validate_password_mixed_case_count=0
#validate_password_number_count=0
#validate_password_special_char_count=0



</code></pre>
<h1>Mysql 8</h1>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2022/01/wp_editor_md_e9564d74360b24e7fdcc437da3ebb670.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2022/01/wp_editor_md_e9564d74360b24e7fdcc437da3ebb670.jpg" alt="" /></a></p>
<pre><code class="language-shell line-numbers">[mysql]
port = 3306
default-character-set=utf8mb4
socket=/data/mysql/mysql.sock

[mysqld]

#----------------优化配置(说明从上到下)
## 支持符号链接，就是可以通过软连接的方式，管理其他目录的数据库，最好不要开启，当一个磁盘或分区空间不够时，可以开启该参数将数据存储到其他的磁盘或分区
#symbolic-links=0
## 设置autocommit=0，则用户将一直处于某个事务中，直到执行一条commit提交或rollback语句才会结束当前事务重新开始一个新的事务(调试模式时使用）
##autocommit=0
## MySQL读入缓冲区的大小
#read_buffer_size = 100M
## MySQL的随机读缓冲区大小、MySQL的顺序读缓冲区大小
#read_rnd_buffer_size = 100M
#sort_buffer_size = 100M

## 连接缓存池大小、临时表大小、临时存放位置
#join_buffer_size = 128M
#tmp_table_size = 100M


##########################
# summary
##########################
#user = mysql
bind-address = 0.0.0.0
port = 3306
#basedir=/data/mysql
#datadir=/data/mysql/data
#socket=/data/mysql/mysql.sock
#tmpdir = /tmp
#pid-file=/tmp/mysqld.pid
#skip-grant-tables
#skip-networking
# 默认安装后error_log,slow_log 日志时间戳默认为UTC
log_timestamps=SYSTEM
explicit_defaults_for_timestamp=1
table_open_cache = 8000

##########################
# 连接超时时间、保持时间、最大传输数据包大小
##########################
connect_timeout = 20
wait_timeout = 600
interactive_timeout=2880000

##########################
# connection
##########################
max_connections = 2000
max_user_connections = 1900
max_connect_errors = 100000
max_allowed_packet = 1G

##########################
# character set
##########################
character-set-server = utf8mb4
collation-server = utf8mb4_bin

##########################
# log bin
##########################
#server-id = 1
#log_bin = mysql-bin
# ROW、STATEMENT、MIXED
#binlog_format = row
#sync_binlog = 1
#expire_logs_days = 7
#binlog_cache_size = 128m
#max_binlog_cache_size = 512m
#max_binlog_size = 256M
#master_info_repository=TABLE
#relay_log_info_repository=TABLE
#log_slave_updates=ON
#binlog_checksum=none

#binlog_ignore_db=information_schema
#binlog_ignore_db=mysql
#binlog_ignore_db=performation_schema
#binlog_ignore_db=sys
#binlog_do_do=
#replicate_ignore_db=information_schema
#replicate_ignore_db=mysql
#replicate_ignore_db=performance_schema
#replicate_ignore_db=sys
#replicate_do_db=

##########################
# gtid
##########################
#gtid_mode = on
#enforce_gtid_consistency = on

##########################
# slave parallel
##########################
#slave_net_timeout=60
#slave_parallel_type=LOGICAL_CLOCK
#slave_parallel_workers=4

##########################
# log relay
##########################
#relay_log = mysql-relay-bin
#relay_log_purge = on
#relay_log_recovery = on
#max_relay_log_size = 1G

##########################
# log error
##########################
log_error=/data/mysql/logs/mysqld_error.log

##########################
# log slow
##########################
##超出次设定值的SQL即被记录到慢查询日志
slow_query_log = on
slow_query_log_file = /data/mysql/logs/mysqld_slow.log
long_query_time = 2
##表示记录下没有使用索引的查询
log_queries_not_using_indexes = on


##记录管理语句
log_slow_admin_statements = 1
##开启复制从库复制的慢查询的日志
log_slow_slave_statements = 1
##设置每分钟增长的没有使用索引查询的日志数量
log_throttle_queries_not_using_indexes = 10
# 3天
#expire_logs_days = 3
#binlog_expire_logs_seconds=259200
#min_examined_row_limit = 100

##########################
# log general
##########################
general_log = on
general_log_file = /data/mysql/logs/mysqld_gener.log


#innodb_lock_wait_timeout=600
#lower_case_table_names=1

</code></pre>
<p><a href="https://www.laobaiblog.top/2022/01/24/mysql5-7-8%e4%bc%98%e5%8c%96%e9%85%8d%e7%bd%aemy-cnf/">Mysql5.7/8优化配置My.cnf</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
