joomla database is not responding - mysql

In the joomla 3.7 site, everything was running OK. But last night suddenly it has gone totally down, throwing error msg
"Application Instantiation Error: Could not connect to MySQL"
The last operation performed by me was editing a comment as admin. When clicked "SAVE" after editing, the error appeared. The tables were MYIASM.
The check_database or repair_database option in cpanel also do not respond. In phpMyAdmin, I can view the table list but running any query is halting with error
"Lost connection to MySQL server during query
.
Can not back up the database either from cpanel or phomyadmin or mysqldump.
2006 - MySQL server has gone away
But I have another drupal database in the same host. Tt is serving the site and all the above operation work on it without any problem.
The joomla db was in myIASM format. after all errors, I tried to convert the tables to InnoDB. But the ALTER TABLE query also halted in middle. Some tables are Innodb and some are MYIASM now.
Please help me to solve the problem.
Update:
After some checking, I found that the database is throwing error as
already has more than 'max_user_connections' active connections when
trying to connect
But there is no active connection visible in "show processlist"

In your .cfg or .ini,
log_warnings=2 for logging to your error log, including connection failure details.
To determine how many connections are possible,
SHOW GLOBAL VARIABLES LIKE 'max_connections'
and increase by 10% with
max_connections=(newlimit)
both within [mysqld], shutdown, restart
remember SET GLOBAL general_log=1 will track everything MySQL is trying to do for your analysis when you are having troubles.
Remember to turn OFF general_log before you go to lunch (or anywhere).

Related

How to fix "Error establishing database connection"

Pretty much every single Wordpress site I've set up with MySQL, sooner or later gives the message Error establishing database connection.
Restarting MySQL fixes it. Until it gets to a certain point, where rebooting the whole server is required, as it just hangs trying to restart it.
This has been various versions of Wordpress, on various versions of Linux.
What is it causing this, and what's the cure?
Can you check the number of open connections using - SHOW STATUS WHERE variable_name = 'Threads_connected';. You can use SHOW processlist to get the number of running process which will show you the number of users. Mostly it is because the credentials are incorrect or the number of open connections have reached the maximum.

Same query times out - Lost connection to MySQL server during query

I know this question has been asked on here before, but it seems like I've tried everything suggested in this answer and this answer, and still no luck. I'm trying to use MySQL Workbench 6.3 on a Windows 10 client, connecting to a Linux MySQL server hosted by GoDaddy/cPanel.
I can connect to the MySQL server with no problems, and usually I have time to run a query or two. Then, within a minute of inactivity between Workbench and the server, I'll run into Error 2013: Lost connection to MySQL server during query. This even happens when running the exact same query, back to back about a minute apart, as shown here (even when the original query is quick; only 0.03 seconds to run):
The same problem persists when I run select sleep(60) immediately upon connecting to the MySQL Server; the connection is usually lost between 30-40 seconds into the execution of the query:
I've checked the MySQL docs, but with no luck. I don't think the problem can be related to packet size, as others have suggested (since the same query will work and then fail later), and my Workbench timeout settings look okay:
Anyone have any idea? The only other thing I can think of is maybe the wait_timeout variable listed in the MySQL docs needs to be increased too, but I guess that would be somewhere on the server side (some have mention my.ini) and I can't find where any MySQL Server files live in the cPanel hosting admin interface. There's a MySQL online client provided through cPanel (phpMyAdmin I think), but it's not nearly as robust and is becoming cumbersome to use. Any help would be appreciated!
I was having the same problem, using MySQL Workbench 6.3.6 on Win10 to connect to a MySQL server on a shared hosting system (Arvixe).
In addition to to the problem described by the OP (lost connection to server), I was also getting an error when attempting to import data from a prior export (similar to what is described here):
Unhandled exception: Error querying security information: Error executing 'SELECT * FROM mysql.user WHERE user = '[username]' and Host = '[host]' ORDER BY User, Host' SELECT command denied to user '[username]'#'[host]' for table 'user' SQL Error: 1142
Apparently, a bug was introduced in MySQL Workbench 6.3.5 (bug report). From the bug report:
It appears the problem arise if connecting with an user with no privileges on the mysql schema.
In other words: users connecting to a shared hosting system.
The proposed solution is to uninstall MySQL Workbench 6.3.6, and install 6.3.4 instead. (6.3.4 can be found in the archives). This solution worked for me.

MySQL localhost: "connection refused"

sorry for this post that it might be repeated, but I could not quite figure out from the other posts still.
I am unable to log on mysql localhost database, and the server is down says mysql#localhost:3366 - Refusing Connections. In mysql workbench start/shutdown mysql server, it is saying the database server instance is unknown (with start server button grayed out) and refreshing the status doesn't help.
Also, the mysql server should always be running automatically in the background whenever PC is restarted, but it is not showing in the services now.
when I try to execute mysqld from cmd, it just shuts down the server. And responds with
-"The Innodb memory heap is disabled"
-"the system tablespace must be writeable"
-"InnoDB init function returned error"
-"InnoDB registration as a storage engine failed"
Anybody has a solution to this? Thanks much!
Install it. Re-install it, if you're convinced it was already installed. The fact that it isn't even listed in the services suggests otherwise however. If it was installed but wouldn't start it would still show up, but not as started.

Difference In Phpmyadmin Mysql web client and Terminal client

I got problem (#2006 Mysql server gone away) with mysql while connecting and performing some operations through web browser.
Operation Listed below:
When Executing big procedure
Importing database dump
When Access some particular tables It immediately throws "Server gone away".
Refer this question for Scenarios: Record Not Inserted - #2006 Mysql server gone away
Note : The above operations are works fine when I perform through terminal.
I tried some configuration as googing stated. That is set wait_timeout, max_allowed_packet. I checked for the bin_log but it is not available.
But the issues will not rectified.
What is the problem & How can I figure out & fix the issue?
what is the different between access phpmyadmin mysql server from web browser and terminal?
Where I can find the mysql server log file?
Note: If you know about any one of the above questions. Please post here. It would be helpful to trace.
Please help me to figure this out..
Thanks in advance...
Basically nothing except phpMyAdmin is limited by PHP's timeout and resource limits (limits to keep a runaway script from bogging down your entire machine for all eternity; see the docs for details of those values. In some cases, you might be authenticating through a different user account (for instance, root#localhost and root#127.0.0.1 aren't the same user), but as long as you're using a user with the same permissions the differences are minimal.
You can read more about logs in the MySQL manual, note that "By default, no logs are enabled (except the error log on Windows)".
Below are answer for question
From my research the problem is that browser have some limit to disconnect the connection i.e timeout connection. So that the above problem raised.
To resolve this problem
Go to /opt/lampp/phpmyadmin and open config.inc.php
add the command $cfg['ExecTimeLimit'] = 0;
Restart the xamp server. Now you can perform any operations.
`
2. Web client is differ from terminal because Terminal client will not getting timeout. Terminal client maintain the connection till the progress completed. I recommenced to use command prompt to import/export/run process by safe way.
Basically phpmyadmin will not have any log file. If you wanna see warnings and error you should configure the log file.
Configuration steps:
Go to /opt/lampp/etc/my.cnf
Add log_bin = /opt/lampp/var/mysql/filename.log
Restart the xamp server. You can get the log information.

MySQL Cluster ERROR 1296 (HY000): Got error 157 'Unknown error code' from NDBCLUSTER

Today my datacenter had a breaker fail which resulted in my servers losing power. I'm running a 4 node MySQL cluster. I restarted the cluster, first the management nodes, then the data nodes, then after the data nodes were running I started the SQL nodes. I then checked the cluster with ndb_mgm -e SHOW. Everything seemed fine until I tried running a query. I got this error,
ERROR 1296 (HY000): Got error 157 'Unknown error code' from NDBCLUSTER
I check the MySQL logs and could not find any errors. I then tried a full shutdown and restart of the MySQL cluster and checked config between the shutdown and start. Everything seemed to check out. I then ran a query on another database using the NDBCLUSTER engine. The query was successful. I've tried searching google but no one seems to have any answers that help. I've checked the config, I've made sure ndbd is running on the data nodes, ect. The other databases seem to be working fine except this one. I have a backup of the database but I would much preferably recover the database if possible.
If anyone has any suggestion or ideas, it would be greatly appreciated.
Thanks in advance.
Error 157 is actually 'could not connect to storage engine' and the fact that MySQL fails to report that error correctly is a bug: http://bugs.mysql.com/bug.php?id=44817
The case described in that bug mentions that you get the error when you try to query a table in NDB when the cluster is still down.
So I'm just guessing, but I would conclude that your cluster is not started. Either you missed starting one of the nodes, or else something went wrong starting one of the nodes.
Check the mysql server is really connected to the NDB storage.
Do from a mysql server that should be connected to NDB
SHOW GLOBAL STATUS LIKE 'Ndb_cluster_node_id';
Is the answer > 0?
SHOW GLOBAL STATUS LIKE 'Ndb_number_of_data_nodes';
Is the answer > 0 ?
If not, then the mysql server is not connected and then i would recommend you check your firewall and /etc/hosts table and make sure you dont have a line like:
127.0.0.1 localhost ..
Best regards
Johan