I stopped the MySQL Service in Windows from TaskManager Option.
And then, I opend and Choosed the port number in "my-default.ini". like following (C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini)
[mysqld]
port = 33062
Saved It.
Then I stated the service 'MySql' from the 'TaskManager'.
I checked the port number from 'mysql command' prompt. but port number is not changed to 33062. Instead of that default port number is there in the 'my.ini' file.
Please show the way to change it.
According to your error,some service has already used it. Depends on your OS,check who are using it. For example for netstat -lp | grep 3306 , you can close this service and restart your mysql or change to another port OR you an change mysql default port to listen in your my. cnf file.
How To Connect to MySQL Server on a Different Port? If your MySQL server is listening on port number different than 3306, you need to specify "--port=portNumber" option to any client program that needs to connect to the server.
Steps to change the port number for MySQL Server 5.7 :
services.msc
(To open services.msc
go to run command and then type services.msc
)C:\ProgramData\MySQL\MySQL Server 5.7
(ProgramData is a hidden folder. So you need to enable the hidden items from Folder Options).MySQL Server 5.7
folder you will find my.ini
file.my.ini
file and search for port
.my.ini
file.(if it brings a file owner error, the quickest hack is to rename the file, edit it accordingly and then save the file as 'my.ini'. You can then proceed to delete the first renamed file.)services.msc
.Follow the following simple steps
Rerun the installer by going to start > MySQL > MySQL Community Installer https://i.stack.imgur.com/s78DN.png
Click on Reconfigure next to MySQL Server
Click and Next
Now change the port numbers to maybe 3309
https://i.stack.imgur.com/zs5Vu.png
Click Next change the password, test it and that ends it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With