Selecting a table is shutting down my MySQL server (Error 2013) - mysql

In my Moodle database, everytime I select the mdl_certificate table, the MySQL server goes down. I thought it could be a problem with the PHPMyAdmin, but I installed the MySQL Workbench and the same still happens.
So I tried the console. The problem persists. I got two prints:
I've never seen this. How can I solve it?
Thanks!
UPDATE:
This is the log around the time the error was showed:
130411 8:51:20 [Note] Plugin 'FEDERATED' is disabled.
130411 8:51:20 InnoDB: The InnoDB memory heap is disabled
130411 8:51:20 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130411 8:51:20 InnoDB: Compressed tables use zlib 1.2.3
130411 8:51:20 InnoDB: Initializing buffer pool, size = 128.0M
130411 8:51:20 InnoDB: Completed initialization of buffer pool
130411 8:51:20 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130411 8:51:20 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
130411 8:51:20 InnoDB: Operating system error number 1392 in a file operation.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: File name .\prestashopprod
InnoDB: File operation call: 'readdir_next_file'.
InnoDB: Error: os_file_readdir_next_file() returned -1 in
InnoDB: directory .\prestashopprod
InnoDB: Crash recovery may have failed for some .ibd files!
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 4793, file name .\mysql-bin.000062
130411 8:51:33 InnoDB: Waiting for the background threads to start
130411 8:51:34 InnoDB: 1.1.8 started; log sequence number 795429719
130411 8:51:34 [Note] Recovering after a crash using mysql-bin
130411 8:51:34 [Note] Starting crash recovery...
130411 8:51:34 [Note] Crash recovery finished.
130411 8:51:34 [Note] Event Scheduler: Loaded 0 events
130411 8:51:34 [Note] wampmysqld: ready for connections.
Version: '5.5.20-log' socket: '' port: 3306 MySQL Community Server (GPL)

The solution was drop the tables and re-create them. Luckly, they were empty.

Related

MySQL Daemon failed to start Linux

I have googled a lot about this issue though there are some solution available however I tried all of them and seems that my issue is slightly different.
Can someone pls help me resolve this.
OS: OEL6.5 Linux
MySQL 5.5
MySQL.log:
180625 12:03:50 [Note] Plugin 'FEDERATED' is disabled.
180625 12:03:50 InnoDB: The InnoDB memory heap is disabled
180625 12:03:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180625 12:03:50 InnoDB: Compressed tables use zlib 1.2.3
180625 12:03:50 InnoDB: Initializing buffer pool, size = 15.0G
180625 12:03:52 InnoDB: Completed initialization of buffer pool
180625 12:03:52 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
180625 12:03:52 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Error: trying to add tablespace 2113 of name './items_table.ibd'
InnoDB: to the tablespace memory cache, but tablespace
InnoDB: 2113 of name './customer_table.ibd' already exists in the tablespace
InnoDB: memory cache!
Important:
Before starting to play with db files make a dump (mysqldump -A > mydb.sql).
Consider following one of the options below:
Moving items_table.ibd out from the directory tree and restarting mysql will fix the Error.
Recreate MySQL data dir: https://dba.stackexchange.com/questions/103625/how-to-reinitialise-var-lib-mysql-files

mysql innodb keeps crashing google cloud sql

My database (mysql) server (google cloud SQL) keeps crashing / restarting and I am at a loss of what to do.
Version: '5.5.46' socket: '' port: 0 (34, 36) (Google)
160427 7:20:12 [Note] : ready for connections.
160427 7:20:12 [Note] Event Scheduler: scheduler thread started with id 1
160427 7:20:12 [Note] Event Scheduler: Loaded 0 events
160427 7:20:11 InnoDB: 5.5.46 started; log sequence number 718527543
InnoDB: buffer...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Starting crash recovery.
160427 7:20:06 InnoDB: Database was not shut down normally!
InnoDB: the log sequence number in the ib_logfiles!
InnoDB: The log sequence number in ibdata files does not match
160427 7:20:06 InnoDB: highest supported file format is Barracuda.
160427 7:20:06 InnoDB: Completed initialization of buffer pool
160427 7:20:06 InnoDB: Initializing buffer pool, size = 96.0M
160427 7:20:06 InnoDB: Compressed tables use zlib 1.2.8
160427 7:20:06 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
160427 7:20:06 InnoDB: The InnoDB memory heap is disabled
160427 7:20:06 [Note] (mysqld 5.5.46) starting as process 392594 ...
160427 7:20:06 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if

error while starting mysql

I am getting Error while starting mysql using xampp . I dont know how to fix this
Error: MySQL shutdown unexpectedly.
This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check
the Windows Event Viewer for more clues
If you need more help, copy and post this
entire log window on the forums
log file says
2014-10-08 11:40:53 5788 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-10-08 11:40:53 5788 [Note] InnoDB: The InnoDB memory heap is disabled
2014-10-08 11:40:53 5788 [Note] InnoDB: Mutexes and rw_locks interlocked functions
2014-10-08 11:40:53 5788 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-10-08 11:40:53 5788 [Note] InnoDB: Not using CPU crc32 instructions
2014-10-08 11:40:53 5788 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2014-10-08 11:40:53 5788 [Note] InnoDB: Completed initialization of buffer pool
2014-10-08 11:40:53 5788 [Note] InnoDB: Highest supported file format is Barracuda.
2014-10-08 11:40:53 5788 [Note] InnoDB: The log sequence numbers 115503975998 and 115503975998 in ibdata files do not match the log sequence number 189324800563 in the ib_logfiles!
2014-10-08 11:40:53 5788 [Note] InnoDB: Database was not shutdown normally!
2014-10-08 11:40:53 5788 [Note] InnoDB: Starting crash recovery.
2014-10-08 11:40:53 5788 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-10-08 11:40:53 11e8 InnoDB: Operating system error number 5 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
InnoDB: Error: could not open single-table tablespace file .\trillium_data\insulist_id_exist.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
what steps should i take?

MySQL service hung in "Starting" mode

I am trying to install multiple instances of MySQL on a Windows Server 2003 using this link.
First instance which is on port 6699 get configured and working successfully. But when I try to install another instance on default port (3306) MySQL service gets hung on "Starting" status. This is the log
140210 17:13:20 [Note] Plugin 'FEDERATED' is disabled.
140210 17:13:20 InnoDB: The InnoDB memory heap is disabled
140210 17:13:20 InnoDB: Mutexes and rw_locks use Windows interlocked functions
140210 17:13:20 InnoDB: Compressed tables use zlib 1.2.3
140210 17:13:20 InnoDB: Initializing buffer pool, size = 128.0M
140210 17:13:20 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
140210 17:13:21 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
140210 17:13:21 InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
140210 17:13:23 InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
140210 17:13:26 InnoDB: Waiting for the background threads to start
140210 17:13:27 InnoDB: 1.1.8 started; log sequence number 0
140210 17:13:27 [Note] Server hostname (bind-address): '0.0.0.0'; port: 6699
140210 17:13:27 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140210 17:13:27 [Note] Server socket created on IP: '0.0.0.0'.
140210 17:13:27 [Note] Event Scheduler: Loaded 0 events
140210 17:13:27 [Note] C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe: ready for connections.
Version: '5.5.25' socket: '' port: 6699 MySQL Community Server (GPL)
140210 17:42:18 [Note] Plugin 'FEDERATED' is disabled.
140210 17:42:18 InnoDB: The InnoDB memory heap is disabled
140210 17:42:18 InnoDB: Mutexes and rw_locks use Windows interlocked functions
140210 17:42:18 InnoDB: Compressed tables use zlib 1.2.3
140210 17:42:19 InnoDB: Initializing buffer pool, size = 128.0M
140210 17:42:19 InnoDB: Completed initialization of buffer pool
140210 17:42:19 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
Observe line 140210 17:42:19 InnoDB: Database was not shut down normally!
InnoDB: The log sequence number in ibdata files does not match
Double check your configuration!
Make a binay backup or entire /var/lib/mysql.
If you don't need most recent data, delete the log files and try to start.
If you need your data, try the followling:
Try innodb_force_recovery = 1 to 6 all six options in an increasing order.
Assume the worst -- innodb disk image corrupted.
If you are lucky you can salvage most of your data, perhaps mysql starts in one of recovery modes, run checksum on each table, see what tables are still ok.
If mysql refuses to start up to certain recovery mode N and crashes on startup with recovery mode N, then go looking for those daily/weekly backups I hope you system was configured to take.

Mysql InnoDB crach

Mysql craches almost every day and I need to restart MYSQL..
Own VPS 512MB ram, mysql logs :
131115 10:03:36 [Note] Plugin 'FEDERATED' is disabled.
131115 10:03:36 InnoDB: The InnoDB memory heap is disabled
131115 10:03:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131115 10:03:36 InnoDB: Compressed tables use zlib 1.2.3.4
131115 10:03:36 InnoDB: Initializing buffer pool, size = 128.0M
131115 10:03:36 InnoDB: Completed initialization of buffer pool
131115 10:03:36 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
131115 10:03:36 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
Is this log about shutting down or starting?
I suppose your machine was abnormally shut down which caused damage of logs. So, your db files are inconsistent because of mysqld was not stopped gracefully and your log-files (durability records) are inconsistent too because of physical storage damage.