Innodb plugins 的安裝(三)

aaqwsh發表於2010-12-25
搞了好幾天,雖然只是裝了個比較老的版本,但是也算一個小的進步。
 
準備調整一下InnoDB的引數:
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /opt/mysqldata/data/
innodb_data_file_path = ibdata1:100M;ibdata2:100M:autoextend
innodb_log_group_home_dir = /opt/mysqldata/data/
innodb_log_files_in_group = 3
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 32M
innodb_additional_mem_pool_size = 4M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 16M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
 
啟動時報錯:
01225 17:41:01 mysqld_safe Starting mysqld daemon with databases from /opt/mysqldata/data
101225 17:41:01 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Error: data file /opt/mysqldata/data/ibdata1 is of a different size
InnoDB: 640 pages (rounded down to MB)
InnoDB: than specified in the .cnf file 6400 pages!
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
101225 17:41:01 [ERROR] Plugin 'InnoDB' init function returned error.
101225 17:41:01 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
101225 17:41:01 [Note] Event Scheduler: Loaded 0 events
101225 17:41:01 [Note] /opt/mysqldata/libexec/mysqld: ready for connections.
Version: '5.1.45-log'  socket: '/opt/mysqldata/mysql.sock'  port: 3306  Source distribution
 
原因是我的引數檔案是cp support-files/my-small.cnf /etc/my.cnf,啟動後mysql自動建立表空間資料檔案和重做日誌檔案,修改引數後再次啟動就會這樣。
對於一個新裝的很好解決,把表空間資料檔案和重做日誌檔案刪除,然後啟動。
101225 17:42:09 mysqld_safe Starting mysqld daemon with databases from /opt/mysqldata/data
101225 17:42:09 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: The first specified data file /opt/mysqldata/data/ibdata1 did not exist:
InnoDB: a new database to be created!
101225 17:42:09  InnoDB: Setting file /opt/mysqldata/data/ibdata1 size to 100 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100
101225 17:42:14  InnoDB: Data file /opt/mysqldata/data/ibdata2 did not exist: new to be created
101225 17:42:14  InnoDB: Setting file /opt/mysqldata/data/ibdata2 size to 100 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100
101225 17:42:18  InnoDB: Log file /opt/mysqldata/data/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /opt/mysqldata/data/ib_logfile0 size to 16 MB
InnoDB: Database physically writes the file full: wait...
101225 17:42:19  InnoDB: Log file /opt/mysqldata/data/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /opt/mysqldata/data/ib_logfile1 size to 16 MB
InnoDB: Database physically writes the file full: wait...
101225 17:42:20  InnoDB: Log file /opt/mysqldata/data/ib_logfile2 did not exist: new to be created
InnoDB: Setting log file /opt/mysqldata/data/ib_logfile2 size to 16 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
101225 17:42:23 InnoDB Plugin 1.0.6 started; log sequence number 0
101225 17:42:23 [Note] Event Scheduler: Loaded 0 events
101225 17:42:23 [Note] /opt/mysqldata/libexec/mysqld: ready for connections.
Version: '5.1.45-log'  socket: '/opt/mysqldata/mysql.sock'  port: 3306  Source distributio
 
 
 
如果是一個使用了的資料庫,就沒這麼簡單了,保留原有的資料檔案不變,再增加其他的;正常關閉資料庫後,刪除重做日誌檔案,當然最好有個全備份,並冷備份了相應的檔案。以上為猜測,有機會驗證一下。
 
所以在安裝的時候就考慮清楚,設定好引數最為簡單。
 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/758322/viewspace-682604/,如需轉載,請註明出處,否則將追究法律責任。

相關文章