本文目錄一覽:
- 1、mysql 5.6.20 佔用內存超大,大概400M左右
- 2、mysql數據庫滿了
- 3、mysql耗內存嗎?應該怎麼處理?
- 4、MySQL數據庫日誌滿了會不會像Oracle一樣不能登錄?使用起來有Oracle那麼麻煩嗎?
- 5、MYSQL所在機器磁盤滿了以後,寫入數據庫會阻塞嗎
- 6、數據庫空間滿了怎麼處理
mysql 5.6.20 佔用內存超大,大概400M左右
解決mySQL佔用內存超大問題
為了裝mysql環境測試,裝上後發現啟動後mysql佔用了很大的虛擬內存,達8百多兆
更改後如下:
innodb_buffer_pool_size=576M -256M InnoDB引擎緩衝區佔了大頭,首要就是拿它開刀
query_cache_size=100M -16M 查詢緩存
tmp_table_size=102M -64M 臨時表大小
key_buffer_size=256m -32M
重啟mysql服務後,虛擬內存降到200以下.
另外mysql安裝目錄下有幾個文件:my-huge.ini 、my-large.ini、my-medium.ini…這幾個是根據內存大小作的建議配置,新手在設置的時候也可以參考一下。
2G內存的MYSQL數據庫服務器 my.ini優化 (my.ini)
2G內存,針對站少,優質型的設置,試驗特:
table_cache=1024 物理內存越大,設置就越大.默認為2402,調到512-1024最佳
innodb_additional_mem_pool_size=8M 默認為2M
innodb_flush_log_at_trx_commit=0 等到innodb_log_buffer_size列隊滿後再統一儲存,默認為1
innodb_log_buffer_size=4M 默認為1M
innodb_thread_concurrency=8 你的服務器CPU有幾個就設置為幾,默認為8
key_buffer_size=256M 默認為218 調到128最佳
tmp_table_size=64M 默認為16M 調到64-256最掛
read_buffer_size=4M 默認為64K
read_rnd_buffer_size=16M 默認為256K
sort_buffer_size=32M 默認為256K
max_connections=1024 默認為1210
試驗一:
table_cache=512或1024
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=1M
innodb_thread_concurrency=8 你的服務器CPU有幾個就設置為幾,默認為8
key_buffer_size=128M
tmp_table_size=128M
read_buffer_size=64K或128K
read_rnd_buffer_size=256K
sort_buffer_size=512K
max_connections=1024
試驗二:
table_cache=512或1024
innodb_additional_mem_pool_size=8M
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=4M
innodb_thread_concurrency=8
key_buffer_size=128M
tmp_table_size=128M
read_buffer_size=4M
read_rnd_buffer_size=16M
sort_buffer_size=32M
max_connections=1024
一般:
table_cache=512
innodb_additional_mem_pool_size=8M
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=4M
innodb_thread_concurrency=8
key_buffer_size=128M
tmp_table_size=128M
read_buffer_size=4M
read_rnd_buffer_size=16M
sort_buffer_size=32M
max_connections=1024
經過測試.沒有特殊情況,最好還是用默認的.
2G內存,針對站多,抗壓型的設置,最佳:
table_cache=1024 物理內存越大,設置就越大.默認為2402,調到512-1024最佳
innodb_additional_mem_pool_size=4M 默認為2M
innodb_flush_log_at_trx_commit=1
(設置為0就是等到innodb_log_buffer_size列隊滿後再統一儲存,默認為1)
innodb_log_buffer_size=2M 默認為1M
innodb_thread_concurrency=8 你的服務器CPU有幾個就設置為幾,建議用默認一般為8
key_buffer_size=256M 默認為218 調到128最佳
tmp_table_size=64M 默認為16M 調到64-256最掛
read_buffer_size=4M 默認為64K
read_rnd_buffer_size=16M 默認為256K
sort_buffer_size=32M 默認為256K
max_connections=1024 默認為1210
thread_cache_size=120 默認為60
query_cache_size=64M
優化mysql數據庫性能的十個參數
(1)、max_connections:
允許的同時客戶的數量。增加該值增加 mysqld 要求的文件描述符的數量。這個數字應該增加,否則,你將經常看到 too many connections 錯誤。 默認數值是100,我把它改為1024 。
(2)、record_buffer:
每個進行一個順序掃描的線程為其掃描的每張表分配這個大小的一個緩衝區。如果你做很多順序掃描,你可能想要增加該值。默認數值是131072(128k),我把它改為16773120 (16m)
(3)、key_buffer_size:
索引塊是緩衝的並且被所有的線程共享。key_buffer_size是用於索引塊的緩衝區大小,增加它可得到更好處理的索引(對所有讀和多重寫),到你能負擔得起那樣多。如果你使它太大,系統將開始換頁並且真的變慢了。默認數值是8388600(8m),我的mysql主機有2gb內存,所以我把它改為 402649088(400mb)。
4)、back_log:
要求 mysql 能有的連接數量。當主要mysql線程在一個很短時間內得到非常多的連接請求,這就起作用,然後主線程花些時間(儘管很短)檢查連接並且啟動一個新線程。
back_log 值指出在mysql暫時停止回答新請求之前的短時間內多少個請求可以被存在堆棧中。只有如果期望在一個短時間內有很多連接,你需要增加它,換句話說,這值對到來的tcp/ip連接的偵聽隊列的大小。你的操作系統在這個隊列大小上有它自己的限制。試圖設定back_log高於你的操作系統的限制將是無效的。
當你觀察你的主機進程列表,發現大量 264084 | unauthenticated user | xxx.xxx.xxx.xxx | null | connect | null | login | null 的待連接進程時,就要加大 back_log 的值了。默認數值是50,我把它改為500。
(5)、interactive_timeout:
服務器在關閉它前在一個交互連接上等待行動的秒數。一個交互的客戶被定義為對 mysql_real_connect()使用 client_interactive 選項的客戶。 默認數值是28800,我把它改為7200。
(6)、sort_buffer:
每個需要進行排序的線程分配該大小的一個緩衝區。增加這值加速order by或group by操作。默認數值是2097144(2m),我把它改為 16777208 (16m)。
(7)、table_cache:
為所有線程打開表的數量。增加該值能增加mysqld要求的文件描述符的數量。mysql對每個唯一打開的表需要2個文件描述符。默認數值是64,我把它改為512。
(8)、thread_cache_size:
可以復用的保存在中的線程的數量。如果有,新的線程從緩存中取得,當斷開連接的時候如果有空間,客戶的線置在緩存中。如果有很多新的線程,為了提高性能可以這個變量值。通過比較 connections 和 threads_created 狀態的變量,可以看到這個變量的作用。我把它設置為 80。
(9)mysql的搜索功能
用mysql進行搜索,目的是能不分大小寫,又能用中文進行搜索
只需起動mysqld時指定 –default-character-set=gb2312
(10)、wait_timeout:
服務器在關閉它之前在一個連接上等待行動的秒數。 默認數值是28800,我把它改為7200。
註:參數的調整可以通過修改 /etc/my.cnf 文件並重啟 mysql 實現。這是一個比較謹慎的工作,上面的結果也僅僅是我的一些看法,你可以根據你自己主機的硬件情況(特別是內存大小)進一步修改。
mysql數據庫滿了
已經滿了是沒辦法優化的,只有增加空間,或者刪除部分不用的數據庫
mysql耗內存嗎?應該怎麼處理?
mysql耗內存嗎?很多人都說MySQL佔用了很大的虛擬內存,那麼這個問題應該怎麼解決呢?下面是我收集整理的一些方法,現在分享給大家!
解決mysql耗內存的具體方法一:
在分析的過程中發現最耗內存的是MySQL,其中近1GB的內存被它吞了,而且不在任務管理器體現出來。這個數據庫軟件是EMS要用到了,所以必須要運行。這個軟件在安裝的時候會根據機器的實際內存自動進行配置,PC機物理內存越多,它默認佔有的內存就越多,難怪3GB的內存被它給吞了近1GB。
優化方法:
1. 退出EMS clientserver
2. 在CMD里運行:net stop mysql
3. 找到MySQL\MySQL Server的安裝目錄,裡面有個my.ini文件,參考附件的配置對參數query_cache_size tmp_table_size myisam_sort_buffer_size key_buffer_size innodb_buffer_pool_size進行修改,注意不要改動innodb_log_file_size,修改前備份my.ini
4. 在CMD里運行:net start mysql,如果提示成功,則說明修改的參數沒有什麼問題,如果失敗,重新調整一下上面的參數
5. 找到EMS 安裝目錄runGUI.bat runServer.bat腳本,找到-Xmx700m,改為-Xmx256m,注意修改前備份這兩個文件,感謝Liping Sun提供幫助
6. 重新運行EMS
前後對比,對於3GB的PC,發現可以節省近1GB的內存。對於2GB的PC,也可以節省600-800MB。優化後發現EMS啟動稍微慢一些,但是其它的軟件運行速度提高了很多,不在經常出現卡機現象了。如果在運行過程中發現EMS特別慢的話,自己也可以適當放大上面提到的一些參數。
my.ini
# MySQL Server Instance Configuration File
# ———————————————————————-
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ———————————————————————-
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# “–defaults-file”.
#
# To run run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld –defaults-file=”C:\Program Files\MySQL\MySQL Server X.Y\my.ini”
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld –install MySQLXY –defaults-file=”C:\Program Files\MySQL\MySQL Server X.Y\my.ini”
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guildlines for editing this file
# ———————————————————————-
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the “–help” option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
#
# CLIENT SECTION
# ———————————————————————-
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
port=3306
[mysql]
default-character-set=utf8
# SERVER SECTION
# ———————————————————————-
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir=”D:/Program Files/MySQL/MySQL Server 5.1/”
#Path to the database root
datadir=”C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/”
# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8
# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB
# Set the SQL mode to strict
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=1510
# Query cache is used to cache SELECT results and later return them
# without actual executing the same query once again. Having the query
# cache enabled may result in significant speed improvements, if your
# have a lot of identical queries and rarely changing tables. See the
# “Qcache_lowmem_prunes” status variable to check if the current value
# is high enough for your load.
# Note: In case your tables change very often or if your queries are
# textually different every time, the query cache may result in a
# slowdown instead of a performance improvement.
query_cache_size=16M
# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable “open-files-limit” in
# section [mysqld_safe]
table_cache=3020
# Maximum size for internal (in-memory) temporary tables. If a table
# grows larger than this value, it is automatically converted to disk
# based table This limitation is for a single table. There can be many
# of them.
tmp_table_size=4M
# How many threads we should keep in a cache for reuse. When a client
# disconnects, the client’s threads are put in the cache if there aren’t
# more than thread_cache_size threads from before. This greatly reduces
# the amount of thread creations needed if you have a lot of new
# connections. (Normally this doesn’t give a notable performance
# improvement if you have a good thread implementation.)
thread_cache_size=64
#*** MyISAM Specific options
# The maximum size of the temporary file MySQL is allowed to use while
# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
# If the file-size would be bigger than this, the index will be created
# through the key cache (which is slower).
myisam_max_sort_file_size=100G
# If the temporary file used for fast index creation would be bigger
# than using the key cache by the amount specified here, then prefer the
# key cache method. This is mainly used to force long character keys in
# large tables to use the slower key cache method to create the index.
myisam_sort_buffer_size=4M
# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you’re not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
key_buffer_size=16M
# Size of the buffer used for doing full table scans of MyISAM tables.
# Allocated per thread, if a full scan is needed.
read_buffer_size=64K
read_rnd_buffer_size=256K
# This buffer is allocated when MySQL needs to rebuild the index in
# REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
# into an empty table. It is allocated per thread so be careful with
# large settings.
sort_buffer_size=256K
#*** INNODB Specific options ***
# Use this option if you have a MySQL server with InnoDB support enabled
# but you do not plan to use it. This will save memory and disk space
# and speed up some things.
#skip-innodb
# Additional memory pool that is used by InnoDB to store metadata
# information. If InnoDB requires more memory for this purpose it will
# start to allocate it from the OS. As this is fast enough on most
# recent operating systems, you normally do not need to change this
# value. SHOW INNODB STATUS will display the current amount used.
innodb_additional_mem_pool_size=9M
# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit=1
# The size of the buffer InnoDB uses for buffering log data. As soon as
# it is full, InnoDB will have to flush it to disk. As it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions).
innodb_log_buffer_size=5M
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system. Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size=32M
# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size=88M
# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency=8
解決mysql耗內存的具體方法二:
更改後如下:
innodb_buffer_pool_size=576M -256M InnoDB引擎緩衝區佔了大頭,首要就是拿它開刀
query_cache_size=100M -16M 查詢緩存
tmp_table_size=102M -64M 臨時表大小
key_buffer_size=256m -32M
重啟mysql服務後,虛擬內存降到200以下.
另外mysql安裝目錄下有幾個文件:my-huge.ini 、my-large.ini、my-medium.ini…這幾個是根據內存大小作的建議配置,新手在設置的時候也可以參考一下。
2G內存的MYSQL數據庫服務器 my.ini優化 (my.ini)
2G內存,針對站少,優質型的設置,試驗特:
table_cache=1024 物理內存越大,設置就越大.默認為2402,調到512-1024最佳
innodb_additional_mem_pool_size=8M 默認為2M
innodb_flush_log_at_trx_commit=0 等到innodb_log_buffer_size列隊滿後再統一儲存,默認為1
innodb_log_buffer_size=4M 默認為1M
innodb_thread_concurrency=8 你的服務器CPU有幾個就設置為幾,默認為8
key_buffer_size=256M 默認為218 調到128最佳
tmp_table_size=64M 默認為16M 調到64-256最掛
read_buffer_size=4M 默認為64K
read_rnd_buffer_size=16M 默認為256K
sort_buffer_size=32M 默認為256K
max_connections=1024 默認為1210
試驗一:
table_cache=512或1024
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=1M
innodb_thread_concurrency=8 你的服務器CPU有幾個就設置為幾,默認為8
key_buffer_size=128M
tmp_table_size=128M
read_buffer_size=64K或128K
read_rnd_buffer_size=256K
sort_buffer_size=512K
max_connections=1024
試驗二:
table_cache=512或1024
innodb_additional_mem_pool_size=8M
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=4M
innodb_thread_concurrency=8
key_buffer_size=128M
tmp_table_size=128M
read_buffer_size=4M
read_rnd_buffer_size=16M
sort_buffer_size=32M
max_connections=1024
一般:
table_cache=512
innodb_additional_mem_pool_size=8M
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=4M
innodb_thread_concurrency=8
key_buffer_size=128M
tmp_table_size=128M
read_buffer_size=4M
read_rnd_buffer_size=16M
sort_buffer_size=32M
max_connections=1024
經過測試.沒有特殊情況,最好還是用默認的.
2G內存,針對站多,抗壓型的設置,最佳:
table_cache=1024 物理內存越大,設置就越大.默認為2402,調到512-1024最佳
innodb_additional_mem_pool_size=4M 默認為2M
innodb_flush_log_at_trx_commit=1
(設置為0就是等到innodb_log_buffer_size列隊滿後再統一儲存,默認為1)
innodb_log_buffer_size=2M 默認為1M
innodb_thread_concurrency=8 你的服務器CPU有幾個就設置為幾,建議用默認一般為8
key_buffer_size=256M 默認為218 調到128最佳
tmp_table_size=64M 默認為16M 調到64-256最掛
read_buffer_size=4M 默認為64K
read_rnd_buffer_size=16M 默認為256K
sort_buffer_size=32M 默認為256K
max_connections=1024 默認為1210
thread_cache_size=120 默認為60
query_cache_size=64M
優化mysql數據庫性能的十個參數
(1)、max_connections:
允許的同時客戶的數量。增加該值增加 mysqld 要求的文件描述符的數量。這個數字應該增加,否則,你將經常看到 too many connections 錯誤。 默認數值是100,我把它改為1024 。
(2)、record_buffer:
每個進行一個順序掃描的線程為其掃描的每張表分配這個大小的一個緩衝區。如果你做很多順序掃描,你可能想要增加該值。默認數值是131072(128k),我把它改為16773120 (16m)
(3)、key_buffer_size:
索引塊是緩衝的並且被所有的線程共享。key_buffer_size是用於索引塊的緩衝區大小,增加它可得到更好處理的索引(對所有讀和多重寫),到你能負擔得起那樣多。如果你使它太大,系統將開始換頁並且真的變慢了。默認數值是8388600(8m),我的mysql主機有2gb內存,所以我把它改為 402649088(400mb)。
4)、back_log:
要求 mysql 能有的連接數量。當主要mysql線程在一個很短時間內得到非常多的連接請求,這就起作用,然後主線程花些時間(儘管很短)檢查連接並且啟動一個新線程。
back_log 值指出在mysql暫時停止回答新請求之前的短時間內多少個請求可以被存在堆棧中。只有如果期望在一個短時間內有很多連接,你需要增加它,換句話說,這值對到來的tcp/ip連接的偵聽隊列的大小。你的操作系統在這個隊列大小上有它自己的限制。試圖設定back_log高於你的操作系統的限制將是無效的。
當你觀察你的主機進程列表,發現大量 264084 | unauthenticated user | xxx.xxx.xxx.xxx | null | connect | null | login | null 的待連接進程時,就要加大 back_log 的值了。默認數值是50,我把它改為500。
(5)、interactive_timeout:
服務器在關閉它前在一個交互連接上等待行動的秒數。一個交互的客戶被定義為對 mysql_real_connect()使用 client_interactive 選項的客戶。 默認數值是28800,我把它改為7200。
(6)、sort_buffer:
每個需要進行排序的線程分配該大小的一個緩衝區。增加這值加速order by或group by操作。默認數值是2097144(2m),我把它改為 16777208 (16m)。
(7)、table_cache:
為所有線程打開表的數量。增加該值能增加mysqld要求的文件描述符的數量。mysql對每個唯一打開的表需要2個文件描述符。默認數值是64,我把它改為512。
(8)、thread_cache_size:
可以復用的保存在中的線程的數量。如果有,新的線程從緩存中取得,當斷開連接的時候如果有空間,客戶的線置在緩存中。如果有很多新的線程,為了提高性能可以這個變量值。通過比較 connections 和 threads_created 狀態的變量,可以看到這個變量的作用。我把它設置為 80。
(9)mysql的搜索功能
用mysql進行搜索,目的是能不分大小寫,又能用中文進行搜索
只需起動mysqld時指定 –default-character-set=gb2312
(10)、wait_timeout:
服務器在關閉它之前在一個連接上等待行動的秒數。 默認數值是28800,我把它改為7200。
註:參數的調整可以通過修改 /etc/my.cnf 文件並重啟 mysql 實現。這是一個比較謹慎的工作,上面的結果也僅僅是我的一些看法,你可以根據你自己主機的硬件情況(特別是內存大小)進一步修改。
MySQL數據庫日誌滿了會不會像Oracle一樣不能登錄?使用起來有Oracle那麼麻煩嗎?
磁盤空間如果滿了不管什麼應用程序都會用不了,Oracle雖然難用但是相對於MySQL還是穩定的。MySQL使用簡單,可能語法跟Oracle不同。另外,數據庫日誌要定時清理。
MYSQL所在機器磁盤滿了以後,寫入數據庫會阻塞嗎
當磁盤空間寫滿了之後,MySQL是無法再寫入任何數據的,包括對錶數據的寫入,以及binlog、binlog-index等文件。
當然了,因為InnoDB是可以把臟數據先放在內存里,所以不會立刻表現出來無法寫入,除非開啟了binlog,寫入請求才會被阻塞。
當MySQL檢測到磁盤空間滿了,它會:
每分鐘:檢查空間是否得到釋放,以便寫入新數據。當發現有剩餘空間了,就會繼續寫入數據,一切照舊。
每十分鐘:如果還是發現沒剩餘空間,則會在日誌中寫入一條記錄,報告磁盤空間滿(這時候只寫入幾個字節還是夠的)。
應該怎麼辦
那麼,當發現磁盤空間滿了之後,我們應該怎麼處理呢,建議:
提高監控系統檢測頻率,預防再次發生;
及時刪除不用的文件,釋放空間;
若有線程因磁盤滿的問題被阻塞了,可先殺掉,等到下一分鐘重新檢測時它可能又可以正常工作了;
可能因磁盤滿導致某些線程被阻塞,引發其他線程也被阻塞,可把導致阻塞的線程殺掉,其他被阻塞的線程也就能繼續工作了。
例外
有個例外的情況是:
當執行 REPAIR TABLE 或者 OPTIMIZE TABLE 操作時,或者執行完 LOAD DATA INFILE 或 ALTER TABLE 之後批量更新索引時,這些操作會創建臨時文件,當執行這些操作過程中mysqld發現磁盤空間滿了,就會把這個涉及到的表標記為crashed,刪掉臨時文件(除了 ALTER TABLE 操作,MySQL會放棄正在執行的操作,刪除臨時文件,釋放磁盤空間)。
備註:當執行這些命令過程中mysqld進程被意外被殺掉的話,其所生成臨時文件不會自動刪除,需要手工刪掉才能釋放磁盤空間。
數據庫空間滿了怎麼處理
估計你的數據庫是Access數據庫
如果以前的數據必須存儲,不能刪除,那麼再創建一個新表,就原來的表重命名,新表的結構必須與原結構完全一樣,新表重命名為原來表的名稱即可。
如果以前的數據可以不保存,將不需要的記錄刪除就可以。
如果能夠轉換為SQL數據庫,存儲量比Access數據庫大得多。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/198397.html