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
@rray are different versions, would have problem?
– Papa Charlie
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.
– rray
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?
– Papa Charlie
@rray If you log into linux via Pen, I can?
– Papa Charlie
– rray
@Rray didn’t even find the folder
data
. I’m on version 5.7– Papa Charlie
Rotate that query
SHOW VARIABLES WHERE Variable_Name = 'datadir'
anything look here– rray
I opened the
mysql.exe
by the old HD prompt and the folderdatadir
points toC:/
. I will try to run Linux later if I don’t try to change the folder. Thanks @rray– Papa Charlie
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?– Guilherme Nascimento
@Guillhermenascimento has no risk of giving some unnatural since they are different versions?
– Papa Charlie
@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.
– Guilherme Nascimento