Happy Coder
Happy Coder

Reputation: 4682

Recover mysql databases from LAMP

I had one lampp installation and now my Ubuntu is not working and bounces back to login screen again and again.

I have a dual boot set-up so I can access Windows 7 and I have mounted the Linux partition on it.

I have databases created with LAMP and is it possible to access this data from windows. Actually where is the MySQL data is stored ? IF I copy that files to XAMPP installation it will recover the databases ?

Upvotes: 0

Views: 2773

Answers (2)

zainudin noori
zainudin noori

Reputation: 191

I found lampp databases inside

/opt/lampp/var/mysql/DATABASE_NAME

Upvotes: 0

Stephan
Stephan

Reputation: 8090

The table files are located in /opt/lampp/var/mysql/[db_name]/ where [db_name] is the name of the database.

If you are using MyISAM you have to copy 3 files per table :

Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format. The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension.

If you are using InnoDB unfortunately you cannot move them:

When MySQL drops a table or a database, it has to delete one or more .frm files as well as the corresponding entries inside the InnoDB data dictionary. Consequently, you cannot move InnoDB tables between databases simply by moving the .frm files.

Upvotes: 3

Related Questions