the MySQL service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
Can anyone resolve this issue? Thanks.
the MySQL service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
Can anyone resolve this issue? Thanks.
In my case, mysqld was starting and stopping with no error message. I needed to open command prompt using "Run as Administrator", and then run mysqld.
I am only doing this for temporary development. I would not recommend running MySQL as an administrator in any case.
This was the final step after the above troubleshooting.
You also might have accidentally added some wrong text in
my.ini
file. Make sure no invalid character is added at the beginning on the file.This may be because of changing
lower_case_table_names
after a server has been already initialized.From the docs:
The solution to this problem is to set
lower_case_table_names
parameter at server installation as described in the following answer:Can't set lower_case_table_names in MySQL 8.x on Windows 10
The same problem happened with me also, noting worked... I first deleted the service (in my case MySQL80 and MySQL) by command:
and then reinstalled MySQL. Mine was MySQL 8.0. And then everything was back to normal.
Also remember to give NETWORK SERVICE permission to the folder:
Data
folderProperties
Security
tabAdvanced
Change Permissions...
Add...
NETWORK SERVICE
Check Names
OK
Full Control
OK
– four timesIf you have changed data directory (the path to the database root in my.ini) to an external hard drive, make sure that the hard drive is connected.