0

I recently tried to run a basic MySQL command. Then I got the following response:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I then figured out that MySQL wasn't running. So I tried to start it and I got the following response: start: Job failed to start

I then I tried the following command: sudo -u mysql mysqld

Then got the following output:

160331 21:09:35 [Note] mysqld (mysqld 5.5.47-0ubuntu0.14.04.1-log) starting as process 6929 ...
160331 21:09:35 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
160331 21:09:35 [Note] Plugin 'FEDERATED' is disabled.
160331 21:09:35 [ERROR] Function 'innodb' already exists
160331 21:09:35 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
160331 21:09:35 [ERROR] Function 'federated' already exists
160331 21:09:35 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
160331 21:09:35 [ERROR] Function 'blackhole' already exists
160331 21:09:35 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
160331 21:09:35 [ERROR] Function 'archive' already exists
160331 21:09:35 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
160331 21:09:35 InnoDB: The InnoDB memory heap is disabled
160331 21:09:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160331 21:09:35 InnoDB: Compressed tables use zlib 1.2.8
160331 21:09:35 InnoDB: Using Linux native AIO
160331 21:09:35 InnoDB: Initializing buffer pool, size = 256.0M
160331 21:09:35 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
160331 21:09:35 [ERROR] Plugin 'InnoDB' init function returned error.
160331 21:09:35 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160331 21:09:35 [ERROR] mysqld: unknown variable 'log_slow_verbosity=query_plan'
160331 21:09:35 [ERROR] Aborting

160331 21:09:35 [Note] mysqld: Shutdown complete

Does anybody have any ideas what's causing it? I see that a bunch of plugins already exist. But I'm a newbie to SQL.

4
  • @moonpoint I have tried editing /etc/my.cf but I get an error no matter what I put in there.
    – Njinx
    Apr 1, 2016 at 1:39
  • I added information about checking on InnoDB problems, but have you examined the contents of the error log file, presuming there is a reference to one in, in /etc/my.cnf. What do you see there? Have you been able to successfully use MySQL previously?
    – moonpoint
    Apr 1, 2016 at 1:49
  • @moonpoint I have been able to use MySQL before. I don't know why it won't start now. I'll check the logs and edit the post.
    – Njinx
    Apr 1, 2016 at 11:45
  • Did you copy the my.cnf configuration file from another system as opposed to the file being one you got when you installed MySQL? I added information to my post below about the log_slow_verbosity error, but its presence makes me wonder where the configuration file you are using orginated.
    – moonpoint
    Apr 1, 2016 at 16:02

1 Answer 1

0

Were you able to successfully use MySQL previously or was this the first time you tried to run it? Have you verified that all of the files and directories listed in its configuration file at /etc/my.cnf exist? If you see a reference in that file to a log-error file check for error messages in that file.

I see "Plugin 'InnoDB' init function returned error. 160331 21:09:35 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed." in the output you posted. The MySQL site has an article "14.19.1 Troubleshooting InnoDB I/O Problems" that suggests:

If something goes wrong when InnoDB attempts to initialize its tablespace or its log files, delete all files created by InnoDB: all ibdata files and all ib_logfile files. If you already created some InnoDB tables, also delete the corresponding .frm files for these tables, and any .ibd files if you are using multiple tablespaces, from the MySQL database directories. Then try the InnoDB database creation again. For easiest troubleshooting, start the MySQL server from a command prompt so that you see what is happening

I see mysqld: unknown variable 'log_slow_verbosity=query_plan' as the last error displayed. According to 5.1.4 Server System Variables, the permitted values for log-slow-verbosity are the numbers 1, 2, or 3 with 1 specifying that only errors be logged, 2 specifying that errors and warnings be logged, and 3 specifying that errors, warnings, and notes be logged. So I would expect something like log_slow_verbosity=2(3 is the default value), instead, if you wanted to control the verbosity of the server in writing error, warning, and note messages to the error log (see 5.4.2 The Error Log). Also, the page at the MySQL site notes:

Errors, warnings, and notes log_error_verbosity was added in MySQL 5.7.2. It is preferred over, and should be used instead of, the older log_warnings system variable.

In addition to using an illegal value for the variable, you appear to be using a version of MySQL prior to that variable being introduced, since I see mysqld 5.5.47-0ubuntu0.14.04.1-log in the output you posted. Removing that line from the MySQL configuration file may not permit MySQL to start, but removing that line should eliminate one of the noted errors.

You could also look for my-default.cnf on your system. That's a template file installed when MySQL is installed. You could search for it with find / -name my-default.cnf. If you find it, you could back up your current my.cnf file and replace it with the default one and then try restarting MySQL to see if that helps. Also, you could rename or move the my.cnf file and try updating MySQL to the latest version with a new my.cnf file from that upgrade.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .