Re: How to re-activate databases

From: Fokke Nauta <usenet_at_solfon.nl>
Date: Wed, 5 Jun 2019 21:05:32 +0200
Message-ID: <glqi3sF5du5U1_at_mid.individual.net>


[Quoted] On 05/06/2019 16:44, Axel Schwenke wrote:
> On 05.06.2019 15:09, Fokke Nauta wrote:
>

>> I recently installed MySQL 8.0.16.0 as new. The default location of the
>> database folder is C:\ProgramData\MySQL\MySQL Server 8.0\Data. How can I
>> make the MySQL server see the old databases? I copied the folders of the
>> databases out of the old database folder into the current database folder,
>> but they don't show up after I restarted MySQL80.

>
> This won't work. For multiple reasons. For once: you must not copy anything
> into or out of the MySQL datadir while the server is running.

[Quoted] Ofcourse I stop the service when I do this, and restart later.

> Also you
> cannot normally copy just a database folder. You must always copy the
> *complete* datadir with all subfolders and files.

[Quoted] I found out later. After copying the complete database folder to the current directory, It worked.

>> Then I changed in the
>> my.ini file the line C:/ProgramData/MySQL/MySQL Server 8.0/Data into
>> "E:/MySQL Database".

>
> That would be indeed the preferred way to reference to another datadir. Just
> make sure that the copy of the datadir is complete. That is has the right
> owner and access permissions.

[Quoted] I guess this means for Unix or Linux. But I'm working with Windows 10 Pro.

> And you should first stop the MySQL service,
> then edit my.ini and then start the MySQL service.

Ofcourse.

>> Restarting the MySQL service did not work, as it crashed.

>
> Details?

[Quoted] No details yet, I don't know what you want. [Quoted] But after copying the complete content of the old database to the current C:\ProgramData\MySQL\MySQL Server 8.0\Data, it worked. But [Quoted] changing the data path line in my.ini in E:/MySQL Database, the service did not start. Message: "The MySQL80 service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs."
I changed datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data into
datadir=E:/Files/Databases/MySQL (changed the path name to avoid spaces)

Weird that this is not accepted.

Thanks for your quick reply.

Fokke Received on Wed Jun 05 2019 - 21:05:32 CEST

Original text of this message