Jesse
Jesse

Reputation: 469

Ubuntu - 12.04 - MySql won't start by using service mysql start

The only way I was able to get MySql to start was to issue:

mysqld

When I issued this command, it started rolling back some database transactions that were conflicted. I have tried issuing

service mysql stop

and all I get is

Unknown instance:

Now when I try to upload anything to WordPress I get a HTTP 500 error. I am assuming this is because MySQL is running under a different user. Any thoughts on how to get this working again?

Upvotes: 19

Views: 59241

Answers (7)

Evan Donovan
Evan Donovan

Reputation: 766

Make sure that you are logged in as a user with the privileges to restart mysql. I always use the root user.

Upvotes: 0

PUSHPRAJ KUMAR
PUSHPRAJ KUMAR

Reputation: 1

I have the same issue with MY-SQL on Ubuntu-14.04. I fixed the issue by commenting configuration in /etc/mysql/my.cnf file.

innodb_buffer_pool_size=10G

innodb_log_file_size=54M

After commenting mysql service runs well..

Note :- If you comment these configuration then default configuration will take care the size of buffer pool and log file. So not any issue . But if you want to mention it manually , then provide 80% of your physical memory to buffer pool size. and 25% of buffer pool size to log file.

Upvotes: 0

srowland
srowland

Reputation: 1705

I had these exact symptoms on Ubuntu 14.04. The mysql --verbose trick yielded "Killed". I ran a dmesg which showed Out Of Memory. So I guess this can be caused by any system resource shortage. I also had nothing in the logs. I increased the memory in the machine and mysql started first time!

Upvotes: 0

microman3000
microman3000

Reputation: 49

I know the thread is old but I found it when trying to find a solution to the same problem. Just want to add my 5 cents. It may help someone else.

After hunting for and trying various solutions, without the drastic uninstall and purge, my solution was ridiculously simple.

My disk was full! I can't believe I didn't check that first. Cleared it out and hey presto!

Upvotes: 2

Dave Horner
Dave Horner

Reputation: 423

MySql does not start when disk space is full, and does not give a detailed error message. To check the free space on the server run:

 df -h /

Upvotes: 20

Augusto
Augusto

Reputation: 2222

try

mysqld --verbose

for more details

Upvotes: 18

Joshua D. Boyd
Joshua D. Boyd

Reputation: 4856

service mysql stop will only work if mysql was started by one of the service start methods, such as service mysql start or start mysql, or /etc/init.d/mysqld start. If you start mysql by launching the daemon directly without using upstart or init.d, then that is why you get the "unknown instance" error. Of course, all of those valid options probably need to be prefixed with sudo if you aren't logged in as root.

Before worrying about the wordpress 500 error, I would first make sure that mysql is started correctly. If it is still running stop it with the kill command. Then, try sudo service mysql start. Then, use ps -ef to see if mysql is running. If not, check the mysql log files (EDIT: also check dmesg). If it is running, try to connect to it with the the mysql command and the credentials in your wordpress config.php file. If that doesn't work, figure out what is wrong there. If it does work, then check the wordpress (really apache most likely), log file.

See also: https://askubuntu.com/questions/125686/mysql-fails-to-start-after-upgrade-installation-etc

Upvotes: 8

Related Questions