kjtocool Posted March 11, 2009 Share Posted March 11, 2009 Hey guys, I'm at my wits end here, and I really don't know what else to do. I operate my own dedicated server and a few sites on it, one site has a phpbb forum, and the forum is encountering issues. The error comes when trying to insert / update records: SQL ERROR [ mysqli ] MySQL server has gone away [2006] SQL SELECT topic_type, forum_id FROM phpbb_topics WHERE topic_id = 0 BACKTRACE FILE: includes/db/mysqli.php LINE: 143 CALL: dbal->sql_error() FILE: posting.php LINE: 871 CALL: dbal_mysqli->sql_query() The server is managed by me, and my host won't help. The only way they will take a look at it is if I pony up $300 for to switch to a managed server. I've restarted, I've upgraded, I've restarted services, I've repaired the database, I've optimized the database, but no avail. The only other thing I can think of is increasing the max_packet_size, but I don't know how to do it. It requires to run something from the command prompt, and I have no experience with that, nor do I know how to do it. (If anyone wants to walk me through it, I'd be grateful) I only have experience within WHM. When I try and manually insert, I get the following: You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit. Which reaffirms the idea that the max_packet_size is an issue. The thing I simply don't get is that I'm only trying to run: insert into phpbb_bots values(1, 1, 't', 1, 't', 't'), so how is this running into a size issue?! Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/ Share on other sites More sharing options...
corbin Posted March 11, 2009 Share Posted March 11, 2009 How long does the page take to load? The MySQL connection could be timing out. Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781751 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 The forum runs fine, just like normal, until I go to post, at which point it hangs and gives the error. The issue just started today, has been fine for over a year, no server changes were made. Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781752 Share on other sites More sharing options...
corbin Posted March 11, 2009 Share Posted March 11, 2009 How large is/are the relevant table(s), and is it (are they) MyISAM or InnoDB? Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781753 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 62 different tables, standard phpbb 3.0, biggest is 659.6 KiB, most much smaller. All are MyISAM. Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781754 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 I just tried the following: SET GLOBAL max_allowed_packet=1000000000; insert into phpbb_bots values(1, 1, 't', 1, 't', 't'); Doing that allowed the statement to execute, but trying to do it without the first statement still doesn't work. It looks like that's my problem, I just don't know how to fix it. Anyone care to give me an idiots guide on how to do this? Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781760 Share on other sites More sharing options...
corbin Posted March 11, 2009 Share Posted March 11, 2009 You will need to change my.ini. Gotta find which ever one MySQL is reading. Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781763 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 How do I change my.ini? Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781768 Share on other sites More sharing options...
corbin Posted March 11, 2009 Share Posted March 11, 2009 With notepad or something. (Or vi or vim or something if you're under linux.) If you're running Windows, which I'm guessing you're not if you have WHM, it will be wherever MySQL is installed. If not, then it could be many places. Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781774 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 Yeah, not running windows, or I would know how to do this. My issue is, I have no idea how to get to the file. There is no access through WHM, I know no other way into the server's files, and I can't connect with the root account via FTP to do it that way. Thus, I'm left sitting here like an idiot, knowing something simple would fix my issue and no idea how to do it. So frustrating, I hate not knowing how to do things that are so simple. Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781778 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 Well, I got SSH access, now it's just a matter of finding the commands to accomplish what I want. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781788 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 Heh, I went ahead and figured out how to add the following to my .my.cnf file: [mysqld] max_allowed_packet=32M It didn't seem to do anything. Any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781801 Share on other sites More sharing options...
kjtocool Posted March 11, 2009 Author Share Posted March 11, 2009 I just ran the following: SHOW VARIABLES LIKE 'max_allowed_packet'; Which returned: max_allowed_packet 33554432 I then tried an insert directly from phpmyadmin, and it now works! Unfortunately, the error still persists on the forum, and now I'm even more confused as to how to fix it. I really appreciate anyone who helps out, I'm losing my mind over here. Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-781805 Share on other sites More sharing options...
aschk Posted March 11, 2009 Share Posted March 11, 2009 Just changing the my.cnf file won't faciliate anything, you'll need to restart the service and verify that the my.cnf is being loaded on startup (should be by default from /etc/my.cnf). Quote Link to comment https://forums.phpfreaks.com/topic/148881-error-mysql-server-has-gone-away-2006/#findComment-782000 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.