mysql: unknown option '--skip-grant-tables' - mysql

I'm using tt-RSS as an rss reader running on a raspberry pi. Lately it's been running really slowly so I checked the logs to see the below error appear when starting mysql
Can't open and lock privilege tables: Incorrect file format 'servers'
So I googled it and found a post saying to use the skip-grant-tables option and repair the database(s) Post. I got as far as running the first command in the answer and now mysql doesn't work. It appears to be running but whenever I run mysql I get the following message mysql: unknown option '--skip-grant-tables' before being sent back to the prompt.
I cant seem to find any reference to this error anywhere and I cant seem to disable the skip grant tables option to go back.
I've rebooted the machine, restarted mysql and mysqld services and looked in the my.cnf file, where it does say [client server]
skip-grant-tables
If I remove that option and restarted the computer/services then mysql fails to start completely. Otherwise I'm stuck at the above error.
Any help in fixing the error and getting mysql working again would be much appreciated.

Related

joomla database is not responding

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).

MySQL server has gone away after Shutdown and Startup Server

I am using MySQL Workbench. I shut down and restart my server. After that I was not able to execute any queries as the error always come up immediately.
Error 2006:MySQL server has gone away
I have started the MySQL57 services manually so I am sure the server is running. Looking up SO, two solutions come up - (1) set max_allowed_packet = 128M in my.ini [Failed], (2) set wait_timeout to a larger number - I cannot find the my.cnf file so this doesn't work.
What I encountered is pretty different from others as they usually had this error after a long piece of queries, but mine just comes up immediately after a query is sent. Appreciate any help (include finding the my.cnf file).
Update:
Discovered something that may help, what I have done:
Start MySQL57 from services.msc manually
Open MySQL Workbench, connect to database
Test the connection, and said "Successfully made the MySQL Connection"
Run a query, return "Error 2013: Cannot connect to MySQL Server on local host"
Run the query again, return "Error 2006: MySQL Server has gone away"
Check services.msc, the MySQL57 has been switched off.

#2002 Cannot log in to the MySQL server error

I cannot log in to my mySQL database server anymore.
I am currently using WAMP 2.2 on Windows 8.1 64 bits.
I tried reinstalling WAMP server but the problem still persists.
I have also edited the config.inc.php file and changed the host name from 'localhost' to '127.0.0.1'; however the problem still exists.
I found the problem, eventually. It had nothing to do with any of the configuration files though.
My ESET Smart Security antivirus updated silently and blocked the mysql application. I did not even get a notification for it!
I figured it out when I tried logging in to phpMyadmin after turning off my antivirus.
I had to allow communication for mysqld.exe in the antivirus settings.
Using the Wampmanager menus take a look at the mysql error log.
left click wampmanager -> MySQL -> MySQL log
If that does not show any [error] messages then also have a look at the 'Windows Event Viewer' in the 'Application' section for messages from MySQL.
The normal problem is a rogue 'my.ini' or 'my.cnf' file on your system. Search for these 2 files in the C;\windows folder, if you find any then delete them.
DO NOT DELETE THE my.ini FILE FREOM ANYWHERE IN THE C;\WAMP folder structure.
Recently I encountered a problem with MySQL, It was showing an error “Error : 1067 the process terminated unexpectedly” when I tried to start the service in services.msc
So I googled it but didn’t found the perfect solution. I will show how can you debug the issue. First look for file my.ini which can be found in “C:\wamp\bin\mysql\mysql5.6.17″ , open that file on look for “log-error”, this will show you the path where error log is stored. In my case it is, “c:/wamp/logs/mysql.log”.
Open the log file and look for last error you got, you should be today’s date when you tried to start the wampmysqld from services. At this stage, you will get error and understand what it say. In my case it is,
enter image description here
The folders for all databases are in “C:\wamp\bin\mysql\mysql5.6.17\data”. To fix I moved kmk folder to some other place. After this, wampmysqld in services.msc is getting started without any error.

Xampp Linux: PDOException: SQLSTATE[HY000] [2002] Connection refused in lock_may_be_available() error

I have been struggling to find a solution for this issue with MySQL. Things changed after I placed a ojdbc jar file on Apache Solr tomcat server. Since then i have been getting this error. It seems there is yet another mysql instance running on the machine.
Xampp Status shows MySQL Database is deactivated. I have been searching for a working solution since this morning but no luck. Your help is very much appreciated.
PS: /opt/lampp/lampp status says mysql is 'running'. When stopped, it reads 'OK' but when starting it again, it says 'already running'....and the Xampp Status page says MySQL database is Deactivated
The command /opt/lampp/lampp status basically goes and check for the pid file
MYSQL_PIDFILE=/opt/lampp/var/mysql/$HOSTNAME.pid
Sometimes this PID file get corrupted (in case of a crash, or procees kill).
In such scenario, the status command will tell you that the mysql is running, where as there is no process that exists for that PID file and the XAMPP status which shows in the browser will not be able to connect to the server (because it is not running) and hence come as deactivated.
Just rename the pid file as $HOSTNAME_bkp.pid or something like that and restart lampp, the issue will get resolved.

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.