Skip to content

Instantly share code, notes, and snippets.

View shishir-bd's full-sized avatar

Shishir Chowdhury shishir-bd

  • Bangladesh
View GitHub Profile
@premitheme
premitheme / README.md
Last active September 3, 2024 20:56
Recover MAMP MySQL database using .frm and .ibd files after InnoDB crash

Recover MAMP MySQL database using .frm and .ibd files after InnoDB crash

After a power faliur (also can be a sudden restart or system crash), I ended up with corrupted database and lost the access to my local hosted websites for development. Even the MAMP's MySQL server was not starting.

Preparation

You will need to find the databases folders, in case of MAMP they are located in Applications/MAMP/db/mysql56 (or mysql57 depending on MySQL version).

You will find folders containing the database name, inside them you will find .frm and .ibd files. Take a copy of the entire folder for backup in another place, the desktop for example.

@kasparsd
kasparsd / php-excel-xlsx-xml.php
Last active January 18, 2021 14:13
Generate the most basic Excel XLSX and XML files in PHP, see https://kaspars.net/blog/wordpress/excel-xlsx-xml-php
<?php
/**
* UPDATE: This has been converted into a proper PHP library,
* see https://github.com/kasparsd/mini-sheets-php
*/
// Note: there are some references to WordPress methods and functions
class cf7_export_excel {