MySQL doesn't starts on AMPPS OS X - mysql

I have I problem with starting mysql using AMPPS. I'm Using OS X Maverics and last version of Ammps. After little system crash and restart I can`t start mysql.
mysql.err
2014-01-22 18:12:41 398 [Note] Plugin 'FEDERATED' is disabled.
2014-01-22 18:12:41 398 [Note] InnoDB: The InnoDB memory heap is disabled
2014-01-22 18:12:41 398 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-01-22 18:12:41 398 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-01-22 18:12:41 398 [Note] InnoDB: Not using CPU crc32 instructions
2014-01-22 18:12:41 398 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-01-22 18:12:41 398 [Note] InnoDB: Completed initialization of buffer pool
2014-01-22 18:12:41 398 [Note] InnoDB: Highest supported file format is Barracuda.
2014-01-22 18:12:41 398 [Note] InnoDB: The log sequence numbers 1252002624 and 1252002624 in ibdata files do not match the log sequence number 1252003161 in the ib_logfiles!
2014-01-22 18:12:41 398 [Note] InnoDB: Database was not shutdown normally!
2014-01-22 18:12:41 398 [Note] InnoDB: Starting crash recovery.
2014-01-22 18:12:41 398 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-01-22 18:12:41 398 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace analytics/backlinks uses space ID: 1 at filepath: ./analytics/backlinks.ibd. Cannot open tablespace mysql/innodb_table_stats which uses space ID: 1 at filepath: ./mysql/innodb_table_stats.ibd
2014-01-22 18:12:41 a08901a8 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./mysql/innodb_table_stats.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.
Help me please. I have very important files in DB.

Solve!
Open AMPPS Application -> MySQL Tab -> Configuration.
In [mysqld] section, add the following line:
innodb_force_recovery = 1
Save the file and try starting MySQL
Remove that line which you just added and Save.

So I was facing a similar issue and what I tried was following:-
find / -name mysql
From the output of above command remove all the search results.Then do following:-
brew uninstall mysql
brew clean
Then reboot your machine once and then install once again using following:-
brew install mysql
P.S: I was getting this error error so I could not take backup of my db but I had not so much important data in DB so I removed it anyways

Related

MySql missing from Services - could not open innodb_index_stats.ibd

I have Ampps 3.7 installed on Windows 10, and whilst Apache runs ok Mysql will no longer start up; It use to run ok but now has an innidb error. My issue is similar to the question here, except that I've not upgraded mysql, and the suggested solution is to delete and reinstate several inno_db tables. However how can I do that when I can't connect to mysql
I've read this and this which both say add the following to my.ini
innodb_force_recovery = 1
The Ampps Mysql error log says:
2018-01-05 12:17:46 11096 [Warning] You need to use --log-bin to make --binlog-format work.
2018-01-05 12:17:46 11096 [Note] Plugin 'FEDERATED' is disabled.
2018-01-05 12:17:46 11096 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-01-05 12:17:46 11096 [Note] InnoDB: The InnoDB memory heap is disabled
2018-01-05 12:17:46 11096 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-01-05 12:17:46 11096 [Note] InnoDB: Memory barrier is not used
2018-01-05 12:17:46 11096 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-01-05 12:17:46 11096 [Note] InnoDB: Not using CPU crc32 instructions
2018-01-05 12:17:46 11096 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-01-05 12:17:46 11096 [Note] InnoDB: Completed initialization of buffer pool
2018-01-05 12:17:46 11096 [Note] InnoDB: Highest supported file format is Barracuda.
2018-01-05 12:17:46 11096 [Note] InnoDB: The log sequence numbers 1600637 and 1600637 in ibdata files do not match the log sequence number 3531342 in the ib_logfiles!
2018-01-05 12:17:46 11096 [Note] InnoDB: Database was not shutdown normally!
2018-01-05 12:17:46 11096 [Note] InnoDB: Starting crash recovery.
2018-01-05 12:17:46 11096 [Note] InnoDB: Reading tablespace information from the .ibd files...
2018-01-05 12:17:46 11096 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace invoiceplane/ip_invoice_custom uses space ID: 2 at filepath: .\invoiceplane\ip_invoice_custom.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd
InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.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.
Any ideas please?
UPDATE:
Deleting the 2 ib_logfile's initially work, but then they reappeared (perhaps after a reboot). By again deleting the 2 files I was able to start mysql, but the following errors are listed:
... Many similar errors precede with different page numbers
2018-01-10 13:24:50 10a8 InnoDB: Error: page 329 log sequence number 2371974
InnoDB: is in the future! Current system log sequence number 1601046.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: for more information.
2018-01-10 13:24:50 980 InnoDB: Error: page 0 log sequence number 3484405
InnoDB: is in the future! Current system log sequence number 1601046.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: for more information.
2018-01-10 13:24:50 3032 [Note] InnoDB: 5.6.35 started; log sequence number 1601036
2018-01-10 13:24:50 3032 [Note] Server hostname (bind-address): '*'; port: 3306
2018-01-10 13:24:50 3032 [Note] IPv6 is available.
2018-01-10 13:24:50 3032 [Note] - '::' resolves to '::';
2018-01-10 13:24:50 3032 [Note] Server socket created on IP: '::'.
2018-01-10 13:24:50 3032 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2018-01-10 13:24:50 3032 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
2018-01-10 13:24:50 3032 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2018-01-10 13:24:50 3032 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2018-01-10 13:24:50 3032 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.
2018-01-10 13:24:50 3032 [Note] Event Scheduler: Loaded 0 events
2018-01-10 13:24:50 3032 [Note] mysql\bin\mysqld.exe: ready for connections.
Version: '5.6.35' socket: '' port: 3306 MySQL Community Server (GPL)
Deleting the log files is obviously not solving the root cause.
Seems I'm not the only one having issues with MySql on Ampps.
I had the exact same problem and fixed it by adding innodb_force_recovery = 1 to my.ini as you pointed out. Don't forget to:
Save configuration and restart MySQL.
Now Stop MySQL, Remove the line just added and start MySQL again.
NOTE: you could also simply change the value of innodb_force_recovery to 0 instead of deleting it
as the link you pointed out here suggests, it is very important
This was the best solution for me unlike those solutions that require you to run sql queries when mysql cannot even start O.o
The answer here worked for me:
open the following folder
Ampps/mysql/data/
delete all files like ib_logfile** and mysql-bin.index,mysql-bin.****,
then start or restart MySQL via the AMPPS pannel
For me there were only 2 ib_logfile's.

Error: could not open single-table tablespace file .\scrapers\records.ibd

I have AMPPS installed on my Windows 10.
I was unable to start MySQL. I have searched through this error and tried different things to recover my data.
This was the error log:
2016-02-03 10:19:54 6448 [Warning] You need to use --log-bin to make --binlog-format work.
2016-02-03 10:19:54 6448 [Note] Plugin 'FEDERATED' is disabled.
2016-02-03 10:19:54 6448 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-02-03 10:19:54 6448 [Note] InnoDB: The InnoDB memory heap is disabled
2016-02-03 10:19:54 6448 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-02-03 10:19:54 6448 [Note] InnoDB: Memory barrier is not used
2016-02-03 10:19:54 6448 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-03 10:19:54 6448 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-03 10:19:54 6448 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-02-03 10:19:54 6448 [Note] InnoDB: Completed initialization of buffer pool
2016-02-03 10:19:54 6448 [Note] InnoDB: Highest supported file format is Barracuda.
2016-02-03 10:19:54 6448 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 132125643 in the ib_logfiles!
2016-02-03 10:19:54 6448 [Note] InnoDB: Database was not shutdown normally!
2016-02-03 10:19:54 6448 [Note] InnoDB: Starting crash recovery.
2016-02-03 10:19:54 6448 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-02-03 10:19:54 6448 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .\mysql\innodb_table_stats.ibd. Cannot open tablespace scrapers/openpasts_records which uses space ID: 1 at filepath: .\scrapers\openpasts_records.ibd
InnoDB: Error: could not open single-table tablespace file .\scrapers\openpasts_records.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.
I have tried setting innodb_force_recovery = 1 in my.cnf
Also I have tried removing ibdata1 file as well.
After removing ibdata1, MySQL started perfectly.
and my table shows in PHPmyADMIN, but when I click on it it says table does not exists even it exists
In my D:\Ampps\mysql\data\scrapers directory, I can see records.ibd file and records.frm file as well. That means table physically exists but is corrupted.
Does someone know how do I recover that table?
set value of
innodb_force_recovery = 1
or 2 or 3 or 4
in my.ini file under [mysql]
try this hopefully it will solve your problem.

MySQL wont start - Database crashed and now I get Error 1067

We have a MySQL database and last night there was a power outage which caused the machine it runs under to crash.
Now with the machine restarted, I am trying to run the MySQL service and I get the error:
"Error 1067: The process terminated unexpectedly"
Extract from the log:
2015-12-14 08:56:17 1248 [Note] Plugin 'FEDERATED' is disabled.
2015-12-14 08:56:17 1248 [Warning] option 'innodb-autoextend-increment': unsigned value 67108864 adjusted to 1000
2015-12-14 08:56:17 d64 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-12-14 08:56:17 1248 [Note] InnoDB: The InnoDB memory heap is disabled
2015-12-14 08:56:17 1248 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-12-14 08:56:17 1248 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-12-14 08:56:17 1248 [Note] InnoDB: Not using CPU crc32 instructions
2015-12-14 08:56:17 1248 [Note] InnoDB: Initializing buffer pool, size = 38.0M
2015-12-14 08:56:17 1248 [Note] InnoDB: Completed initialization of buffer pool
2015-12-14 08:56:17 1248 [Note] InnoDB: Highest supported file format is Barracuda.
2015-12-14 08:56:17 1248 [Note] InnoDB: The log sequence numbers 33664440039 and 33664440039 in ibdata files do not match the log sequence number 35948349561 in the ib_logfiles!
2015-12-14 08:56:17 1248 [Note] InnoDB: Database was not shutdown normally!
2015-12-14 08:56:17 1248 [Note] InnoDB: Starting crash recovery.
2015-12-14 08:56:17 1248 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-12-14 08:56:24 1248 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .\mysql\innodb_table_stats.ibd. Cannot open tablespace teamcity/action_history which uses space ID: 1 at filepath: .\teamcity\action_history.ibd
InnoDB: Error: could not open single-table tablespace file .\teamcity\action_history.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.
Anyone have a solution to this?
The solution, as the message indicates, is likely to be performing innodb_force_recovery > 0.
To do this, just edit my.cnf, search the file for innodb_force_recovery, it'll look like this:
#innodb_force_recovery = 0
Edit it thusly:
innodb_force_recovery = 2
Then restart the MySQL service. After stopping and restarting it, go back and replace the # in the my.cnf file, then restart the service again. Hopefully, you are able to access your tables. If not, try repeating the process, only set the value to 3 instead. Do not go higher than 3 without further researching innodb_force_recovery.
Best of luck, hope this helps.

restore mysql database from an old mysql folder

i want to restore one database from my old mysql folder,
i copied mysql/data folder from old installation into my current mysql folder, yet its not starting up any more.
when i check the error_log file i see
2014-05-04 11:01:24 5344 [Note] Plugin 'FEDERATED' is disabled.
2014-05-04 11:01:24 1d5c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2014-05-04 11:01:24 5344 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-04 11:01:24 5344 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-05-04 11:01:24 5344 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-05-04 11:01:24 5344 [Note] InnoDB: Not using CPU crc32 instructions
2014-05-04 11:01:24 5344 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2014-05-04 11:01:24 5344 [Note] InnoDB: Completed initialization of buffer pool
2014-05-04 11:01:24 5344 [Note] InnoDB: Highest supported file format is Barracuda.
2014-05-04 11:01:24 5344 [Note] InnoDB: The log sequence numbers 1689664 and 1689664 in ibdata files do not match the log sequence number 3461183 in the ib_logfiles!
2014-05-04 11:01:24 5344 [Note] InnoDB: Database was not shutdown normally!
2014-05-04 11:01:24 5344 [Note] InnoDB: Starting crash recovery.
2014-05-04 11:01:24 5344 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-05-04 11:01:24 5344 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace database/settings uses space ID: 146 at filepath: .\database\settings.ibd. Cannot open tablespace elegant/encounter_dr which uses space ID: 146 at filepath: .\elegant\encounter_dr.ibd
InnoDB: Error: could not open single-table tablespace file .\elegant\encounter_dr.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.
i'm not sure what exactly is the problem, i copied the folder as is.. may be its a different mysql version (2years old backup) but i'm sure everthing is there !.
is there anyother way to restore database from data folder ?
I saw in log file that elegant db is causing the problem, since i dont even need it i deleted the hole folder. now mysql starts but it show only tables, and when ever i try to use this table it say Table doesnot exists
i check log now there is a new errors
2014-05-04 11:03:41 7828 [Warning] InnoDB: Cannot open table z125/inventory_items from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2014-05-04 11:03:41 7828 [Warning] InnoDB: Cannot open table z125/inventory_transactions from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.

MYSQL Wont start - using Xibo on Xampp

Restarted my server
getting no where with this error
tried changing port numbers
trid changing permissions on the specific it asked.
any help with this will be greatly appreciated.
I'm using XIBO on xamppp and the MYSQL database wont start so now i cant configure the XIBO, but when XAMPP is running without MYSQL i can view the content.
Below are the logs of the problem i am having.
Again thanking you in advance regarding this.
2013-11-27 09:29:11 848 [Note] Plugin 'FEDERATED' is disabled.
2013-11-27 09:29:11 ea0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2013-11-27 09:29:11 848 [Note] InnoDB: The InnoDB memory heap is disabled
2013-11-27 09:29:11 848 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2013-11-27 09:29:11 848 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-11-27 09:29:11 848 [Note] InnoDB: Not using CPU crc32 instructions
2013-11-27 09:29:11 848 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2013-11-27 09:29:11 848 [Note] InnoDB: Completed initialization of buffer pool
2013-11-27 09:29:11 848 [Note] InnoDB: Highest supported file format is Barracuda.
2013-11-27 09:29:11 848 [Note] InnoDB: The log sequence numbers 3140458 and 3140458 in ibdata files do not match the log sequence number 3747628 in the ib_logfiles!
2013-11-27 09:29:11 848 [Note] InnoDB: Database was not shutdown normally!
2013-11-27 09:29:11 848 [Note] InnoDB: Starting crash recovery.
2013-11-27 09:29:11 848 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-11-27 09:29:11 848 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .\mysql\innodb_table_stats.ibd. Cannot open tablespace xibo/bandwidth which uses space ID: 1 at filepath: .\xibo\bandwidth.ibd
InnoDB: Error: could not open single-table tablespace file .\xibo\bandwidth.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.
If your computer running "skype", just quit it then start MySQL. Because they both may use same port number