mysql啟動錯誤: [ERROR] Can't find messagefile '/usr/share/errmsg.sys'
我的mysql是安裝在/usr/local/mysql目錄下,bin/mysqld_safe --user=mysql &啟動後,從日誌檔案中發現如下錯誤:
- 110623 21:49:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
- 110623 21:49:41 [ERROR] Can't find messagefile '/usr/share/errmsg.sys'
- 110623 21:49:41 [Warning] Can't create test file /var/lib/mysql/ubuntu.lower-test
- 110623 21:49:41 [Warning] Can't create test file /var/lib/mysql/ubuntu.lower-test
- /usr/local/mysql/bin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)
- 110623 21:49:41 [ERROR] Aborting
從日誌上發現,mysql的啟動目錄不對。
修改啟動命令:
sudo mysqld_safe --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql &
即可啟動成功:
110623 21:49:41 [Note]
110623 21:49:41 mysqld_safe mysqld from pid file /var/lib/mysql/ubuntu.pid ended
110623 21:57:21 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/
110623 21:57:21 InnoDB: The InnoDB memory heap is disabled
110623 21:57:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110623 21:57:21 InnoDB: Compressed tables use zlib 1.2.3.3
110623 21:57:21 InnoDB: Initializing buffer pool, size = 128.0M
110623 21:57:21 InnoDB: Completed initialization of buffer pool
110623 21:57:21 InnoDB: highest supported file format is Barracuda.
110623 21:57:21 InnoDB: Waiting for the background threads to start
110623 21:57:22 InnoDB: 1.1.7 started; log sequence number 1607993
110623 21:57:22 [Note] Event Scheduler: Loaded 0 events
110623 21:57:22 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.13' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Source distribution