標籤:linux
今天公司很久以前的一台WDCP整合的Web服務出現了問題,開啟網頁顯示“無法串連mysql,請檢查mysql是否已啟動及使用者密碼是否配置正確”
????
?????????????????(為伺服器故障時Web訪問報錯資訊)
????
????在網上找了三個小時的資料,找到了很多遇到該問題的朋友,並且只要是資料庫連接不正常的或者資料庫無法正常啟動的,全都會報這個錯誤,下面是我的解決方案:
1、檢查服務運行狀態
[[email protected] etc]# service mysqld status
?mysql is not running.
#mysql服務並未運行
[[email protected] etc]# service mysqld restart
?ERROR! MySQL manager or server PID file could not be found!
Starting MySQL. ERROR! Manager of pid-file quit without updating file.
#試圖重啟服務,結果報錯
[[email protected] etc]# cat /www/wdlinux/mysql-5.1.69/var/WDCP.err
查看WDCP的錯誤記錄檔
? ? 171209 16:10:02 mysqld_safe mysqld from pid file /www/wdlinux/mysql-5.1.69/var/WDCP.pid ended
????171209 16:12:25 mysqld_safe Starting mysqld daemon with databases from /www/wdlinux/mysql-5.1.69/var
????171209 16:12:25 [ERROR] /www/wdlinux/mysql-5.1.69/libexec/mysqld: unknown variable ‘innodb_additional_mem_pool_size=16M‘
????171209 16:12:25 [ERROR] Aborting
????#從日誌看為止的innodb我覺定把innodb的選項注釋掉看一下,結果重啟服務報了一個新的錯誤。
????171209 16:10:02 mysqld_safe mysqld from pid file /www/wdlinux/mysql-5.1.69/var/WDCP.pid ended
????171209 16:12:25 mysqld_safe Starting mysqld daemon with databases from /www/wdlinux/mysql-5.1.69/var
????171209 16:12:25 [ERROR] /www/wdlinux/mysql-5.1.69/libexec/mysqld: unknown variable ‘innodb_additional_mem_pool_size=16M‘
????171209 16:12:25 [ERROR] Aborting
????
????171209 16:12:25 [Note] /www/wdlinux/mysql-5.1.69/libexec/mysqld: Shutdown complete
????
????171209 16:12:25 mysqld_safe mysqld from pid file /www/wdlinux/mysql-5.1.69/var/WDCP.pid ended
????171209 16:13:32 mysqld_safe Starting mysqld daemon with databases from /www/wdlinux/mysql-5.1.69/var
????171209 16:13:32 [ERROR] /www/wdlinux/mysql-5.1.69/libexec/mysqld: unknown variable ‘innodb_buffer_pool_size=2G‘
????171209 16:13:32 [ERROR] Aborting
????#還是和innodb有關係,決定吧所有的innodb都登出掉!!!? ??
????171209 16:13:32 [Note] /www/wdlinux/mysql-5.1.69/libexec/mysqld: Shutdown complete
????
????171209 16:13:32 mysqld_safe mysqld from pid file /www/wdlinux/mysql-5.1.69/var/WDCP.pid ended
????171209 16:14:34 mysqld_safe Starting mysqld daemon with databases from /www/wdlinux/mysql-5.1.69/var
????171209 16:14:35 [ERROR] /www/wdlinux/mysql-5.1.69/libexec/mysqld: unknown variable ‘innodb_buffer_pool_size=2G‘
????171209 16:14:35 [ERROR] Aborting
????
????171209 16:14:35 [Note] /www/wdlinux/mysql-5.1.69/libexec/mysqld: Shutdown complete
????
????171209 16:14:35 mysqld_safe mysqld from pid file /www/wdlinux/mysql-5.1.69/var/WDCP.pid ended
? ? #在/www/wdlinux/etc/my.cnf有關innodb的選項全部注釋掉
????#innodb_buffer_pool_size = 2G
????#innodb_data_file_path = ibdata1:10M:autoextend
????#innodb_file_io_threads = 4
????#innodb_thread_concurrency = 16
????#innodb_flush_log_at_trx_commit = 1
????#innodb_log_buffer_size = 8M
????#innodb_log_file_size = 256M
????#innodb_log_files_in_group = 3
????#innodb_max_dirty_pages_pct = 90
????#innodb_lock_wait_timeout = 120
????啟動mysql服務進行測試:
????
????[[email protected] ~]# service mysqld start
????Starting MySQL. SUCCESS!
? ? #mysql啟動成功
????具體原因暫時還沒找到,主要是因為這不是主要的業務系統,以及該系統是前期開發人員搭建的,所以存在一些問題,此文檔僅作為簡單記錄,查出具體問題後會整理詳細文檔。
WDCP開啟網頁時報錯:無法串連mysql,請檢查mysql是否已啟動及使用者密碼是否配置正確