mysql怎麼增加記憶體 MySQL記憶體不足怎麼辦

2021-10-17 13:38:02 字數 1015 閱讀 5284

mysql記憶體不足的解決方法:1、增加swap交換空間,**為【dd if=/dev/zero of=/swapfile bs=1m count=1024】;2、增加自動掛載,在檔案【/etc/fstab中加入/swapfileswap】。

mysql記憶體不足的解決方法:

1、啟動mysql時一直不成功,檢視錯誤日誌 /var/log/mysql/error.log

2、主要的錯誤資訊有如下幾條:[error] innodb: mmap(136151040 bytes) failed; errno 12

[error] innodb: cannot allocate memory for the buffer pool

[error] innodb: plugin initialization aborted with error generic error

[error] plugin 'innodb' init function returned error.

[error] plugin 'innodb' registration as a storage engine failed.

[error] failed to initialize plugins.

[error] aborting

3、查詢後是因為記憶體不足,檢視記憶體

增加swap交換空間解決問題:

dd if=/dev/zero of=/swapfile bs=1m count=1024

mkswap /swapfile

swapon /swapfile

4、增加自動掛載:

在檔案/etc/fstab中加入 /swapfile swap swap defaults 0 0

service mysql start 啟動成功

5、備註:

生成空檔案dd if=/dev/zero of=1.txt bs=1m count=2 生成乙個指定大小的空檔案

if=檔名:輸入檔名

of=檔名:輸出檔名

bs=位元組大小

php修改mysql密碼 怎麼修改mysql密碼

怎麼修改mysql密碼?修改mysql密碼的方法 方法1 用set password命令 首先登入mysql。格式 mysql set password for 使用者名稱 localhost password 新密碼 例子 mysql set password for root localhost...

php增加mysql索引 mysql怎麼新增索引

在mysql中可以通過使用alter table這個sql語句來為表中的字段新增索引。1 新增primary key 主鍵索引 mysql alter table table name add primary key column 2 新增unique 唯一索引 mysql alter table ...

怎麼增加mysql許可權 mysql新增許可權許可權使用者

文章目錄 1 create database dbtest 2 create user testuser identified by 123456 3 grant select,insert,update,references,delete,create,drop,alter,index,trigg...