Reputation: 560
MySQL Service don't start automatically on system bootup, and when I try to start MySQL service it shows the following output
C:\Windows\system32>net start MySQL
The MySQL service is starting.
The MySQL service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
Please suggest some way to solve the problem, if you ever came across such a problem.
Upvotes: 3
Views: 11871
Reputation: 1
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.
Open the file where you exported the permissions, and in the first line, change the folder name to the one for which you want to copy the permissions.
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.All that's left is to enable "permission inheritance" for the folder with the data, with checkbox "replacing all permissions of the child objects" (something like this). As I understand it, otherwise NETWORK SERVICE won’t have the necessary permissions for the files that will be synchronized through the drive.
Upvotes: 0
Reputation: 13148
In Windows, it does not seem to put any error information in EventViewer. To find error info, in your my.ini
file, look for a line like this:
# Error Logging.
log-error="SERVERNAME.err"
look for that .err file in your installation directory (dir /s *.err
) and it should have information about what is going wrong.
Except that, it seems when starting the server (ie: net start mysql
), it still does not log there, so lookup your service and try the command manually at the command line.
It should be something like this:
<install_path>\bin\mysqld.exe --defaults-file="<path_to_my_ini>" <instance_name>
Try that same command manually, except for some reason remove the <instance_name>
part. You should then get both error output from mysqld.exe
and something written to SERVERNAME.err
.
For me the problem was: I had stupidly removed an empty Uploads folder and redundant my.ini
from the data path. It wanted that Uploads folder to exist. Once the Uploads folder was remade, and the my.ini
copied back, the service started.
Upvotes: 0
Reputation: 42
Restarting the Host Network Service on Windows solved the problem.
You can do this with an admin Powershell/ Command Prompt session by running:
net stop hns
net start hns
Upvotes: 0
Reputation: 419
The easiest way to resolve the error where the service does not start is by going into the registry as Administrator.
Navigate to HKLM\System\ControlSet001\Services\MySQL Change image path to "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe" --defaults-file=C:\Program Files\MyNewSQL\bin\MyNewSQL.ini MyNewSQL
My problem (same as yours):
Current Registry Setting: C:\MySQLs\MySQLDev\bin\mysqld --defaults-file=C:/MySQLs/MySQLDev/MySQLDev.ini MySQLDev
Change Registry Setting to: C:\MySQLs\MySQLDev\bin\mysqld.exe --defaults-file=C:/MySQLs/MySQLDev/MySQLDev.ini MySQLDev
Rerun "net start MySQLDev"
The MySQLDev service is starting. The MySQLDev service was started successfully.
Upvotes: 0
Reputation: 61
My MySQL80 server failed to start because my.ini was saved with UTF-8 encoding instead of ANSI.
Upvotes: 6