Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
NoGi Posted May 31, 2015 Posted May 31, 2015 Anyone come across this error:[Sun May 31 11:16:23 2015] [error] [client 116.88.78.3] PHP Fatal error: Call to a member function fetch_fi[Sun May 31 14:48:59 2015] [error] [client 121.222.49.124] PHP Fatal error: Call to a member function fetch_field() on a non-object in /var/www/mysite/public_html/forum/system/Db/Select.php on line 327 [Sun May 31 14:48:59 2015] [error] [client 188.165.15.202] PHP Fatal error: Call to a member function fetch_field() on a non-object in /var/www/mysite/public_html/forum/system/Db/Select.php on line 327 [Sun May 31 14:53:22 2015] [error] [client 66.249.75.71] PHP Fatal error: Uncaught exception 'ErrorException' with message 'mysqli::prepare(): Couldn't fetch IPS\\Db' in /var/www/mysite/public_html/forum/system/Db/Db.php:360\nStack trace:\n#0 [internal function]: IPS\\IPS::errorHandler(2, 'mysqli::prepare...', '/var/www/shrimp...', 360, Array)\n#1 /var/www/mysite/public_html/forum/system/Db/Db.php(360): mysqli->prepare('/*IPS\\\\Session\\\\_...')\n#2 /var/www/mysite/public_html/forum/system/Db/Db.php(622): IPS\\_Db->preparedQuery('REPLACE INTO `c...', Array)\n#3 /var/www/mysite/public_html/forum/system/Session/Front.php(274): IPS\\_Db->replace('core_sessions', Array, true)\n#4 [internal function]: IPS\\Session\\_Front->write('a0i90v8mj62shjn...', '')\n#5 {main}\n thrown in /var/www/mysite/public_html/forum/system/Db/Db.php on line 360 [Sun May 31 14:53:27 2015] [error] [client 124.181.238.11] PHP Fatal error: Uncaught exception 'ErrorException' with message 'mysqli::prepare(): Couldn't fetch IPS\\Db' in /var/www/mysite/public_html/forum/system/Db/Db.php:360\nStack trace:\n#0 [internal function]: IPS\\IPS::errorHandler(2, 'mysqli::prepare...', '/var/www/shrimp...', 360, Array)\n#1 /var/www/mysite/public_html/forum/system/Db/Db.php(360): mysqli->prepare('/*IPS\\\\_Task::qu...')\n#2 /var/www/mysite/public_html/forum/system/Db/Select.php(321): IPS\\_Db->preparedQuery('SELECT * FROM `...', Array)\n#3 /var/www/mysite/public_html/forum/system/Db/Select.php(377): IPS\\Db\\_Select->runQuery()\n#4 /var/www/mysite/public_html/forum/system/Task/Task.php(110): IPS\\Db\\_Select->rewind()\n#5 /var/www/mysite/public_html/forum/system/Dispatcher/Standard.php(292): IPS\\_Task::queued()\n#6 [internal function]: IPS\\Dispatcher\\_Standard->__destruct()\n#7 {main}\n thrown in /var/www/mysite/public_html/forum/system/Db/Db.php on line 360, referer: http://mysite/forum/index.php?/messenger/5101/ [Sun May 31 14:53:27 2015] [error] [client 124.181.238.11] PHP Fatal error: Uncaught exception 'ErrorException' with message 'mysqli::prepare(): Couldn't fetch IPS\\Db' in /var/www/mysite/public_html/forum/system/Db/Db.php:360\nStack trace:\n#0 [internal function]: IPS\\IPS::errorHandler(2, 'mysqli::prepare...', '/var/www/shrimp...', 360, Array)\n#1 /var/www/mysite/public_html/forum/system/Db/Db.php(360): mysqli->prepare('/*IPS\\\\Session\\\\_...')\n#2 /var/www/mysite/public_html/forum/system/Db/Db.php(622): IPS\\_Db->preparedQuery('REPLACE INTO `c...', Array)\n#3 /var/www/mysite/public_html/forum/system/Session/Front.php(274): IPS\\_Db->replace('core_sessions', Array, true)\n#4 [internal function]: IPS\\Session\\_Front->write('7dr7gu251pq1foi...', '')\n#5 {main}\n thrown in /var/www/mysite/public_html/forum/system/Db/Db.php on line 360, referer: http://mysite/forum/index.php?/messenger/5101/ [Sun May 31 14:53:45 2015] [error] [client 121.222.157.100] PHP Fatal error: Uncaught exception 'ErrorException' with message 'mysqli::prepare(): Couldn't fetch IPS\\Db' in /var/www/mysite/public_html/forum/system/Db/Db.php:360\nStack trace:\n#0 [internal function]: IPS\\IPS::errorHandler(2, 'mysqli::prepare...', '/var/www/shrimp...', 360, Array)\n#1 /var/www/mysite/public_html/forum/system/Db/Db.php(360): mysqli->prepare('/*IPS\\\\_Task::qu...')\n#2 /var/www/mysite/public_html/foru I've raised a support ticket but given it's a weekend, not sure if I'll hear anything
Daniel F Posted May 31, 2015 Posted May 31, 2015 Thats probably an issue with the database connection.Verify that the SQL credentials in the conf_ file are correct and that the db server is running
NoGi Posted May 31, 2015 Author Posted May 31, 2015 No creds are fine, this has been running fine for a few days now. I just ran a check on the DB and found this error:myforum_ipb.core_mail_error_logsError : Table './myforum_ipb/core_mail_error_logs' is marked as crashed and should be repairedError : Table 'core_mail_error_logs' is marked as crashed and should be repairederror : Corrupt
NoGi Posted May 31, 2015 Author Posted May 31, 2015 Actually running the db scan seems to have fixed it
不中用 Posted May 31, 2015 Posted May 31, 2015 Actually running the db scan seems to have fixed it.What version of MySQL are you running ? MyISAM or innodb ? .
RevengeFNF Posted May 31, 2015 Posted May 31, 2015 Actually running the db scan seems to have fixed itMove your tables from MyISAM to InnoDB so you can be safe from tables being marked as crashed.
NoGi Posted May 31, 2015 Author Posted May 31, 2015 Is it a easy process? I've got a test environment I can try it out on.
RevengeFNF Posted May 31, 2015 Posted May 31, 2015 Yes its easy. Backup or DB first, and just run this code:alter table ibf_forums_posts ENGINE=InnoDB;Do that for every table. After that, its best to also optimize your my.cnf to InnoDB(we can help you with that):
NoGi Posted May 31, 2015 Author Posted May 31, 2015 Is there a way to do the whole DB rather than table at a time? That would take a very long time. This is my /etc/my.cnf as well btw[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 innodb_buffer_pool_size=1G innodb_log_file_size=256M innodb_flush_neighbors=0 innodb_flush_log_at_trx_commit=2 ft_min_word_len = 3 # Default to UTF-8 for text columns character-set-client-handshake=FALSE character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci #collation-server=utf8mb4_general_ci [client] socket=/var/lib/mysql/mysql.sock default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
NoGi Posted May 31, 2015 Author Posted May 31, 2015 Prod:# ./mysqltuner.pl >> MySQLTuner 1.4.0 - Major Hayden <major@mhtx.net> >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering [OK] Currently running supported MySQL version 5.6.24 [OK] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM [--] Data in MyISAM tables: 66M (Tables: 176) [--] Data in InnoDB tables: 46M (Tables: 62) [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52) [!!] Total fragmented tables: 10 -------- Security Recommendations ------------------------------------------- [OK] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [--] Up for: 7h 13m 42s (112K q [4.338 qps], 4K conn, TX: 1B, RX: 39M) [--] Reads / Writes: 89% / 11% [--] Total buffers: 1.0G global + 1.1M per thread (151 max threads) [OK] Maximum possible memory usage: 1.2G (69% of installed RAM) [OK] Slow queries: 0% (0/112K) [OK] Highest usage of available connections: 3% (6/151) [OK] Key buffer size / total MyISAM indexes: 8.0M/30.0M [OK] Key buffer hit rate: 99.5% (16M cached / 80K reads) [!!] Query cache is disabled [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 10K sorts) [!!] Joins performed without indexes: 597 [!!] Temporary tables created on disk: 46% (2K on disk / 4K total) [OK] Thread cache hit rate: 99% (6 created / 4K connections) [OK] Table cache hit rate: 27% (257 open / 943 opened) [OK] Open file limit used: 4% (245/5K) [OK] Table locks acquired immediately: 99% (134K immediate / 134K locks) [OK] InnoDB buffer pool / data size: 1.0G/46.8M [OK] InnoDB log waits: 0 -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Adjust your join queries to always utilize indexes When making adjustments, make tmp_table_size/max_heap_table_size equal Reduce your SELECT DISTINCT queries without LIMIT clauses Variables to adjust: query_cache_type (=1) join_buffer_size (> 256.0K, or always use indexes with joins) tmp_table_size (> 16M) max_heap_table_size (> 16M) Dev:# ./mysqltuner.pl >> MySQLTuner 1.4.0 - Major Hayden <major@mhtx.net> >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering [OK] Currently running supported MySQL version 5.6.24 [OK] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM [--] Data in MyISAM tables: 66M (Tables: 174) [--] Data in InnoDB tables: 44M (Tables: 62) [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52) [!!] Total fragmented tables: 15 -------- Security Recommendations ------------------------------------------- [OK] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [--] Up for: 7d 9h 48m 6s (2M q [3.165 qps], 5K conn, TX: 7B, RX: 352M) [--] Reads / Writes: 81% / 19% [--] Total buffers: 169.0M global + 1.1M per thread (151 max threads) [OK] Maximum possible memory usage: 338.9M (34% of installed RAM) [OK] Slow queries: 0% (0/2M) [OK] Highest usage of available connections: 3% (6/151) [OK] Key buffer size / total MyISAM indexes: 8.0M/29.6M [OK] Key buffer hit rate: 99.9% (13M cached / 17K reads) [!!] Query cache is disabled [!!] Sorts requiring temporary tables: 11% (2K temp sorts / 17K sorts) [OK] Temporary tables created on disk: 2% (11K on disk / 406K total) [OK] Thread cache hit rate: 99% (6 created / 5K connections) [OK] Table cache hit rate: 24% (241 open / 980 opened) [OK] Open file limit used: 24% (251/1K) [OK] Table locks acquired immediately: 99% (1M immediate / 1M locks) [OK] InnoDB buffer pool / data size: 128.0M/44.6M [OK] InnoDB log waits: 0 -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance Variables to adjust: query_cache_type (=1) sort_buffer_size (> 256K) read_rnd_buffer_size (> 256K)
RevengeFNF Posted May 31, 2015 Posted May 31, 2015 You have a small Database, so i think its good. join_buffer_size is a bit lower and you can also increase the temp table size.Now for innodb use also this:innodb_file_per_tableinnodb_flush_method = O_DIRECTtransaction-isolation = READ-COMMITTEDIf you also don't want the buffer pool to warm up everytime you restart your mysql server, you can add this:innodb_buffer_pool_dump_at_shutdown = 1innodb_buffer_pool_load_at_startup = 1
NoGi Posted May 31, 2015 Author Posted May 31, 2015 Is there a way to convert the whole database instead of table by table?
RevengeFNF Posted May 31, 2015 Posted May 31, 2015 I tink there are batch scripts to do them all. Never used them.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.