当前位置:网站首页>Stop automatically after MySQL starts (unable to start)

Stop automatically after MySQL starts (unable to start)

2022-06-23 01:58:00 XUchenmp

Among the numerous blogs on the Internet, those solutions failed to solve my problem , Stop copying each other , Ten blogs are the same as eight .

error

The log error port is occupied ,netstat -ano No processes are found to be in use , Modified into 3307 After that, the error of port occupation is reported .
 Insert picture description here

reason

Hyper -v Occupied 3306 The port of , Lead to mysql Can't start .
1. Why can I start before ?
because Hyper The occupied port is not fixed .
2. Why did it change 3307 Not good either. ?
Because of bad luck ,3307 It happens to be .
The following figure shows the port occupancy for two restarts
 After restart, I found that the occupied port has changed Not enough technology , Luck , As long as you are lucky , There would be no such problem

terms of settlement

The command line checks the port usage

netsh interface ipv4 show excludedportrange protocol=tcp

If the port is occupied, the following methods can be used
1. Turn off the hyper
But I want to use docker, Turn off the docker Can't use
2. Exclude port occupancy
1. Turn off the hyper, Restart the computer
2. Start as Administrator cmd Window input the following command

netsh int ipv4 add excludedportrange protocol=tcp startport=3306 numberofports=1

3. open hyper
When checking the port occupancy again, I found that 3306 Has been ruled out
 Insert picture description here

Solutions ( You can have a look if you are interested )

mysql For startup errors or other errors, check the error log first , stay data Under the table of contents .err Postfix file , After getting the knowledge of port occupancy, check the port occupancy first , At this time, it is found that the port is not occupied by the process , That could be a system problem, not mysql The problem. , Find a solution through the keywords occupied by the port , The final discovery is hyper The problem of , After finding the cause, it will be solved .

summary

all the time , Meet all kinds of bug Or all kinds of errors are mindless paste error information to Baidu , Although in most cases it does happen very quickly , But maybe I don't know why . If a relatively rare error occurs , It may be that a lot of reading repeated blogs cannot be solved . So if you have time, you'd better look at the bottom log , Look at the underlying source code , Don't be afraid and lazy . Although it's really hard for junior programmers , But just because it's hard doesn't mean you can't understand it at all . After all, senior programmers come from junior programmers . Mutual encouragement

原网站

版权声明
本文为[XUchenmp]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202220506264032.html