Save database from another HD

Asked

Viewed 67 times

0

I had a main hard drive with my webserver - Apache, PHP, Mysql - but it gave problem and could not access anymore. I had to format a new hard drive and reinstall my environment. The problem is that there was no time to export the database.

I installed everything on the new HD, and already tried to enter the command line of the old HD to export, but it only runs on Mysql from the new HD.

I opened a CMD with the command below changing the unit C:/ by the old one, I gave a show databases but it didn’t work.

"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" "--defaults-file=C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" "-uroot" "-p" "--default-character-set=utf8"


I don’t know if I did it right or wrong at some stage, but it is possible, via the command line, to save the database that is on another hard drive?

  • Tried to copy folder data Mysql on old hard drive?

  • @rray are different versions, would have problem?

  • Which versions? in theory changes the 'rules' the stored mode should not change mto of one version p another (guess). If you really need it, it’s worth a try.

  • Later I will take a backup and replace the folder to see if it resolves and comment. By the command line should not have access to the corresponding DB?

  • @rray If you log into linux via Pen, I can?

  • 1
    1. I don’t know. 2) maybe :)
  • @Rray didn’t even find the folder data. I’m on version 5.7

  • 1

    Rotate that query SHOW VARIABLES WHERE Variable_Name = 'datadir' anything look here

  • I opened the mysql.exe by the old HD prompt and the folder datadir points to C:/. I will try to run Linux later if I don’t try to change the folder. Thanks @rray

  • It will look a lot like gambiarra, but just tried to finish mysql, copy the folder /data mysql of the old installation and overwrite the new one and restart mysql?

  • @Guillhermenascimento has no risk of giving some unnatural since they are different versions?

  • 1

    @Papacharlie Download, yes, better copy only the files that represent the old tables. I’ve actually been there, but it’s a case-by-case thing.

Show 7 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.