mysql innodb 设置,Mysql5.5 InnoDB存储引擎简单设置
環(huán)境為CentOS系統(tǒng),1G內(nèi)存,Mysql5.5.30。
在/etc/my.cnf內(nèi)添加:
skip-external-locking
skip-name-resolve
max_connections = 1024
query_cache_size = 16M
sort_buffer_size = 1M
table_cache = 256
innodb_buffer_pool_size = 128M
innodb_additional_mem_pool_size = 4M
innodb_log_file_size = 128M
innodb_log_files_in_group = 2
innodb_log_buffer_size = 2M
innodb_flush_log_at_trx_commit = 1
修改前先將mysql服務(wù)停止:
service mysqld restart
由于修改了日志大小重啟會(huì)報(bào)錯(cuò):
130319 04:45:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130319 05:02:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130319 5:02:54 [Note] Plugin ‘FEDERATED’ is disabled.
130319 5:02:59 InnoDB: The InnoDB memory heap is disabled
130319 5:02:59 InnoDB: Mutexes and rw_locks use InnoDB’s own implementation
130319 5:02:59 InnoDB: Compressed tables use zlib 1.2.3
130319 5:02:59 InnoDB: Using Linux native AIO
130319 5:03:01 InnoDB: Initializing buffer pool, size = 128.0M
130319 5:03:02 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 134217728 bytes!
130319 5:03:02 [ERROR] Plugin ‘InnoDB’ init function returned error.
130319 5:03:02 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
130319 5:03:02 [ERROR] Aborting
將/var/lib/mysql下原先的ib_logfile0、ib_logfile1刪除再重啟mysql。
service mysqld start
正常啟動(dòng):
130319 05:20:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130319 05:22:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130319 5:22:56 [Note] Plugin ‘FEDERATED’ is disabled.
130319 5:22:57 InnoDB: The InnoDB memory heap is disabled
130319 5:22:57 InnoDB: Mutexes and rw_locks use InnoDB’s own implementation
130319 5:22:57 InnoDB: Compressed tables use zlib 1.2.3
130319 5:22:57 InnoDB: Using Linux native AIO
130319 5:22:57 InnoDB: Initializing buffer pool, size = 128.0M
130319 5:22:57 InnoDB: Completed initialization of buffer pool
130319 5:22:57 InnoDB: highest supported file format is Barracuda.
130319 5:22:58 InnoDB: Waiting for the background threads to start
130319 5:22:59 InnoDB: 5.5.30 started; log sequence number 2621452
130319 5:22:59 [Note] Server hostname (bind-address): ‘0.0.0.0’; port: 3306
130319 5:22:59 [Note] – ‘0.0.0.0’ resolves to ‘0.0.0.0’;
130319 5:22:59 [Note] Server socket created on IP: ‘0.0.0.0’.
130319 5:23:00 [Warning] ‘proxies_priv’ entry ‘@ root@server08’ ignored in –skip-name-resolve mode.
130319 5:23:04 [Note] Event Scheduler: Loaded 0 events
130319 5:23:04 [Note] /usr/libexec/mysqld: ready for connections.
Version: ‘5.5.30’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 MySQL Community Server (GPL) by Remi
使用mysqladmin variables命令可查看所有參數(shù)變量。
參考資料:
http://www.linuxyan.com/database/106.html
總結(jié)
以上是生活随笔為你收集整理的mysql innodb 设置,Mysql5.5 InnoDB存储引擎简单设置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: libsvm java api文档,li
- 下一篇: 织梦缩略图php,dedecms怎么实现