Re: How to re-activate databases

From: Fokke Nauta <usenet_at_solfon.nl>
Date: Wed, 5 Jun 2019 21:35:44 +0200
Message-ID: <glqjsfF5qidU1_at_mid.individual.net>


On 05/06/2019 21:05, Fokke Nauta wrote:
> 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. 

>
> 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.

>
> 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. 

>
> 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?

>
> No details yet, I don't know what you want.
> But after copying the complete content of the old database to the
> current C:\ProgramData\MySQL\MySQL Server 8.0\Data, it worked. But
> 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
>

[Quoted] [Quoted] I have copied all the contents of the folder E:/Files/Databases/MySQL to [Quoted] the folder C:/ProgramData/MySQL/MySQL Server 8.0/Data. OK, it works.
But due to my backup system I want all other datbases to be it the same folder E:/Files/Databases/..
The MySQL database as well. So I thought to be clever and created a symbolic link from E:/Files/Databases/MySQL to C:/ProgramData/MySQL/MySQL Server 8.0/Data, in order to keep the MySQL database in the same folder.
Didn't work. The MySQL service didn't want to start again with the same message.

Any more tricks to make it work?

Fokke Received on Wed Jun 05 2019 - 21:35:44 CEST

Original text of this message