3

I'm pretty sure this issue has occured before and I've looked around some of the answers. However, I wasn't able to find someone with an exactly similar problem so I thought I'll ask a new question. :(

My websites are showing "Error establishing a database connection" and I've tried to restart MySQL. I check the log and this was the error messages. Any help will be greatly appreciated, I've spent quite a bit of time on this but to no avail.

2018-08-01T17:18:51.984109Z 0 [Note] InnoDB: Unable to open the first data file
2018-08-01T17:18:51.984121Z 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
2018-08-01T17:18:51.984129Z 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'
2018-08-01T17:18:51.984133Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
2018-08-01T17:18:51.984139Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2018-08-01T17:18:51.984145Z 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2018-08-01T17:18:51.984150Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2018-08-01T17:18:52.584934Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-08-01T17:18:52.584967Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-08-01T17:18:52.584972Z 0 [ERROR] Failed to initialize builtin plugins.
2018-08-01T17:18:52.584975Z 0 [ERROR] Aborting

2018-08-01T17:18:52.584990Z 0 [Note] Binlog end
2018-08-01T17:18:52.585049Z 0 [Note] Shutting down plugin 'MyISAM'
2018-08-01T17:18:52.585068Z 0 [Note] Shutting down plugin 'CSV'
2018-08-01T17:18:52.585461Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2018-08-01T17:18:52.641840Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-08-01T17:18:52.641897Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-08-01T17:18:52.807083Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-08-01T17:18:52.808242Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.23-0ubuntu0.16.04.1) starting as process 609 ...
2018-08-01T17:18:52.812171Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-08-01T17:18:52.812195Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-08-01T17:18:52.812199Z 0 [Note] InnoDB: Uses event mutexes
2018-08-01T17:18:52.812203Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-08-01T17:18:52.812206Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-08-01T17:18:52.812210Z 0 [Note] InnoDB: Using Linux native AIO
2018-08-01T17:18:52.812492Z 0 [Note] InnoDB: Number of pools: 1
2018-08-01T17:18:52.812615Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-08-01T17:18:52.814284Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-08-01T17:18:52.822729Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-08-01T17:18:52.825024Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-08-01T17:18:52.835092Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2018-08-01T17:18:52.835119Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2018-08-01T17:18:52.835123Z 0 [Note] InnoDB: Retrying to lock the first data file
2018-08-01T17:18:53.835259Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2018-08-01T17:18:53.835290Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2018-08-01T17:18:54.835429Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 
1
0

To transform codes to text use perror:

perror 11
OS error code  11:  Resource temporarily unavailable

As the request for lock on ibdata1 is already locked by another mysqld process the attempt of lock is rejected.

Terminating the other mysqld process of seeing if it is in a sane state to use is the appropriate course of action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.