restore mysql database from an old mysql folder - mysql

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.

Related

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.

MySQL doesn't starts on AMPPS OS X

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

Table "mysql"."innodb_table_stats" not found

Guys I installed xampp with mysql yday. managed to created a simple db with a single table.
This morning, for some reason Apache is running in my control panel but mysql gives a 'Error:mySQL Shoudown unexpectedly.' Reading the log, apparently some "innodb_table_stats" cannot be found/reached. If it helps, I was playing with the my.cnf as discussed here (MySQL Server has gone away when importing large sql file) yday.
Follows the full log.
2013-12-05 09:18:16 2660 [Note] Plugin 'FEDERATED' is disabled.
2013-12-05 09:18:16 124c 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-12-05 09:18:16 2660 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-05 09:18:16 2660 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2013-12-05 09:18:16 2660 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-05 09:18:16 2660 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-05 09:18:16 2660 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2013-12-05 09:18:16 2660 [Note] InnoDB: Completed initialization of buffer pool
2013-12-05 09:18:16 2660 [Note] InnoDB: Highest supported file format is Barracuda.
2013-12-05 09:18:16 2660 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 5602287 in the ib_logfiles!
2013-12-05 09:18:16 2660 [Note] InnoDB: Database was not shutdown normally!
2013-12-05 09:18:16 2660 [Note] InnoDB: Starting crash recovery.
2013-12-05 09:18:16 2660 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-12-05 09:18:17 2660 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace intrasdata#00201#002e0#002e0/intrasextract uses space ID: 2 at filepath: .\intrasdata#00201#002e0#002e0\intrasextract.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.
I would reinstall mysql server again, or the full xampp if its easier for you.

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