I changed the database storage location (datadir in my.ini), and after that, the server stopped starting successfully. It turned out that the permissions on the new folder were set incorrectly - https://stackoverflow.com/a/52540174.
However, I wanted to synchronize the database between two PCs through a shared folder on a drive. So on the second PC, I had to copy the permissions from the original folder (MySQL Server 8.0) to the folder located on the cloud drive. So I also encountered this problem there Just in case, I'll share the response from GPT, as it might be useful to someone:
Export permissions from the source folder:
icacls "C:\path\to\source\folder" /save "C:\path\to\permissions_file.txt" /t /c /q
This command saves the access permissions of all files and folders to the specified text file.
Apply the permissions to the target folder:
icacls "C:\path\to\target\folder" /restore "C:\path\to\permissions_file.txt"
This command will apply the saved permissions to the target folder and its contents.
Explanation of the flags:
user — applies the action to all files and folders inside the specified directory./c — continues execution even if errors occur./q — disables output of successful operation messages.