phpmyadmin mysql gone away - mysql

I got the "MySQL has gone away" error in phpMyAdmin when trying to display a single database.
I have 9 databases in MySQL and the 8 of them works fine, but when I try to display the one database that I want to use it fails with "MySQL has gone away" error. I have tried to increase max_allowed_packet and wait_timeout but with no success.
If I display the site that uses this database there is no error.
I am on Ubuntu and running mysql as localhost.
Any help is well appreciated.

Got it solved somehow by issuing some mysqladmin commands via terminal.

Related

mysql xampp MariaDB doesn't show all databases

First, I want to say that i am a beginner of mysql.
I installed xampp and i'm trying to work out with mysql and i started the mysqld which gives me some errors on Innodb. When I digit show databases; I get returned only 2 databases, the standard, while in phpmyadmin it shows much more databases, more of those was been created by me.
Why?
You are not logged into MySQL with sufficient privileges to see all the databases.

How to solve "#2006 - MySQL server has gone away" AND "ERROR 2013 (HY000): Lost connection to MySQL server during query"

When I'm trying to browse a table in phpmyadmin, it outputs "#2006 - MySQL server has gone away" as error. Please help to find a solution for this problem. I'm using lampp in ubuntu12.04. And also it output as error "ERROR 2013 (HY000): Lost connection to MySQL server during query" from ubuntu terminal.
Try changing the max_allowed_packet setting to a larger value in the server.
Open "my.ini/cnf", located in your MySQL installation folder, and under [mysqld] section change "max_allowed_packet = 64M" and don't forget to restart the server. You can check the value by executing:
SHOW VARIABLES LIKE 'max_allowed_packet';
Refer: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
It you constantly get this when you query the same table then that table is most probably corrupt. Which means that the MySQL thread dies, hence the "has gone away" message.
Repair the table and if the problems persist, upgrade the server are the options I have for you.

MySQL "#2006 - MySQL server has gone away" in phpMyAdmin

The Problem
My MySQL database works fine for my web application. However, when I try to open the database with phpMyAdmin, I get this error message:
#2006 - MySQL server has gone away
And phpMyAdmin disconnects back to the login screen. Other databases work fine.
My ax_allowed_packet is set to 16. I also tried 64, but it didn't work.
Also this error occured eventually. The database is about 3 MB in size, so not very big.
Used Software
Debian Squeeze x64
MySQL (current version)
phpMyAdmin (current version)
Question
How can I fix this error in order to view and edit my database in phpMyAdmin again?
I finally found it.
Apparently, there were some incompatibility issues after upgrading to MySQL 5.6.
In order to check for such issues and fix them, you will need to do a MySQL Upgrade.
Just run the following on a terminal:
mysql_upgrade -u root -p
Enter your password, and wait until the upgrade finishes.
This fixed the problem for me.
My Reputation is not high enough so i can't comment so i will here, mysql_upgrade -u root -p worked for me i had the same issue, after upgrading mysql, everything worked. i could could log into the database using phpmyadmin but when i tried to add a user it failed , giving MySQL “#2006 - MySQL server has gone away”, Note that i also updated phpmyadmin with yum update phpmyadmin first before running mysql_upgrade -u root -p.
Now all works fine, thanks!

phpMyAdmin is giving me error on login to remote.. #2002 Cannot log in to the MySQL server

I am trying to setup phpMyAdmin to use with a remote MySQL databases on Scientific Linux release 6.2.
If I use the mysql command line to connect to the remote database it works great but if I use mysqladmin I am getting "#2002 Cannot log in to the MySQL server".
I have found if I do a:
setenforce 0
It will work from myphpadmin to my remote database but once I reboot or set Scientific Linux setenforce back to one it stops working again..
I know setenforce 0 is not the right thing to do but can someone please give me details steps on how to get this working the right way... thanks I am new to Scientific Linux and been having some issues.. thanks
I got it working just now... All I had to do was setsebool -P httpd_can_network_connect=1 and now its working

MySQL suddenly stopped LAMP stack

I have been using the LAMP stack on a Ubuntu setup.
It has been working fine, set up multiple databases everything is going fine, and then suddenly this morning I started getting database errors from the webpage I was using, then trying to access PHPMyAdmin got:
error #2002 Cannot log in to the MySQL server
I go into the bash prompt and try to log-in as the root user see whats up I get a similar error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
I checked that the mysql.sock file existed which it does, in the specified path in the error above. Permissions where all good, and owned by mysql. I reset the permissions just in case and still get the same error.
Here is the file as seen from BASH:
srwxrwxrwx 1 mysql mysql 0 Oct 21 05:10 mysqld.sock
I thought I would just restart the service, but get the same error when trying to stop, start or restart the service.
This really baffled me, I am no expert with linux or anything, but don't understand how this can suddenly happen when I didn't change any of the config settings, and it was running perfectly fine for the last few months.
I tried restarting Apache, and got the error:
apache2: bad user name ${APACHE_RUN_USER}
I don't think that is related to the MySQL stuff but thought it could be involved. The Apache error seems to more be with the set-up but knowing my luck being lazy has caused my to overlook simple things that has caused it all to come crashing down.
Any help on how to fix the problem, and more importantly prevent this occurrence the future would be greatly appreciated.
I have tried most things that were returned by a basic Google search, and a look around here. I have not yet tried deleting and recreating the sock file, but most other things so far have not worked.
EDIT:
I just wanted to add that the Apache server is still running fine, nothing wrong there even though I do get the error when trying to stop and restart it. Pages that don't rely on MySQL still load without issue.
I have also tried killing mysql processes through searching the PIDs and also as suggested below killall mysqld (and also killall mysql just for kicks). No processes found through these attempts.
I don't know if it is relevant or not, but I can't open (in vim) or view the mysqld.sock file (permission denied) even when using the superuser.
Have you tried using
killall mysqld
to kill the server instead of just ending the service, and then starting the MySQL service?
Or you could try deleting mysql.sock using
rm /var/run/mysqld/mysqld.sock
Then you would just need to run the MySQL server again by either starting the service or running
mysqld
It should create a new /var/run/mysqld/mysqld.sock for itself and all should go well.
Just a thought: this may have happened because the computer wasn't powered-off correctly, or perhaps MySQL just got a bit confused.
Create one micro instance swap space in Ubuntu
dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile
did you try to just restart the mysql server
/etc/init.d/mysqld restart
/etc/init.d/mysqld stop
/etc/init.d/mysqld start