restore mysql database from files in data directory.

Hi all experts.
I have operated mysql database on linux server for a while and the server seems damaged from power supply problem.(not sure exactly)
Nothing is quite working well. I am not able to start any major damons like apache, mysql, proftpd.... So I am going to setup a new machine.
The problem is that I can't run mysql damon any more which means I can't get the most recent backup files, but I can access the mysql directory. I do have some backup files, however I would like to restore the data as much as possible. So I am wondering if I can restore the database by creating a database on a new server and put all the data files(*.frm, *.MYD, *.MYI) from the old server to the new server's mysql data directory.
Please give me some advise on it.

When it comes to backing up MySQL databases, don't ignore the most obvious solution: making copies of the database files themselves.

Because MySQL uses the same table format on different platforms, it's actually possible to copy MySQL table and index files from one platform and use them on another without any difficulties (assuming, of course, that you're using the same version of MySQL on both platforms).

So which files should you copy? MySQL stores all its databases in a special data/ directory, which is further divided into subdirectories, one for each database. Tables and table indexes are represented as files, with the file name equal to the table name plus an extension.

The easiest approach is to just copy the entire data/ directory to backup media, and archive it so that you can get it back at any time. You might want to write a script to automate the copy. You can then pop the script into your crontab so it can run on a daily or weekly basis, depending on how frequently your databases get updated.

If you're moving files between Windows and UNIX platforms, there is one thing that can trip you up. UNIX file names are case-sensitive, while Windows names are not. Therefore, mixed-case MySQL table names are likely to get corrupted when moved between Windows and UNIX (though the data in the tables will be fine). If your SQL code uses these mixed-case table names, it might not work correctly until you check and fix the names and/or the code. For best results, always use lowercase table names, so that you don't encounter this problem.

Everything worked good.
I just copied all database files to the new server and worked.
Just one thing I want to add for other user, when I first run the database query from the new server, I only had read-only access to all tables even though I connected to it as root. So I simple dump all tables in the database to a sql file and dropped the database, recreated it and reloaded all data from the file.
After that, everything went back to normal and worked like charming.
I want to ask you just one more thing.
Is there a way to run a script that dump all database tables in a file and email it to me everyday?
I don't have no mail server program installed on my server.

>>I want to ask you just one more thing.
>>Is there a way to run a script that dump all database tables in a file and email it to me everyday?
>>I don't have no mail server program installed on my server.

Yes you can dump all database tables in a single file,

This is for single database dump..
mysqldump -uusername -p --add-drop-table databasename > mydump.sql

And to dump all the databases on the system, use the --all-databases

mysqldump -uusername -p --all-databases databasename > mydump.sql

And you can send email but for this you need a mail/sendmail installed on your box and also that supports huge file attachment..
better you can get a reminder after the backup which should be enough for you..

Introduction
Since I wrote the original article about
Handling Date and Time in PHP and MySQL
several years ago, it seemed like now was a good time to update it for object-oriented PHP. This article does that, replacing as much as possible the pr…

In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster.
To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB.
To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…