I copied the raw MySQL files of my website from the database directory because my phpmyadmin does not work. How can i create a sql or csv file from all the db files and then import them into my older server’s phpMyadmin?
Regards
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Never do such “backups”.
You will need exact same version (or very similar) of mysql server that created files.
Install MySQL server and copy your files into folder under data directory (while mysql not running yet or stop it first).
Then start server and check log.If no fatal error inside, you win.
Also, if tables are created by InnoDB engine, you will need transaction logs files also.
Maybe you will not able to restore it correctly at all.
For next time, best way to do such thing and avoid doing some magic is to use mysqldump.
UPDATE:
let’s say your username is dbuser and your password is dbpass and your database is called mydb.Then you can create full solid backup by issuing following command from server where mysql is running:
after this you can import sql file into other mysql server by issuing following command:
Some detailed article on this here
Also take a look here : https://stackoverflow.com/questions/2707930/mysql-db-import-export-command-line-in-windows
Some further reading: