Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have installed Mysql 5.1 on Mac OS X 10.7 Lion. For some reason, though, when I try starting the server with the command "mysqld" I get an error in the log file which says:
120328 21:32:40 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
120328 21:32:40 [ERROR] Do you already have another mysqld server running on port: 3306 ?
120328 21:32:40 [ERROR] Aborting
If I run "netstat -nat | grep 3306" in my terminal, I get the following:
tcp4 0 0 *.3306 . LISTEN
UPDATE:
So here's the output for that.
mysqld 24645 sb1752 12u IPv4 0xffffff8010f6bde0 0t0 TCP *:mysql (LISTEN)
This is odd though! Because my mysql server is not started.
When I type "mysql" in command line, it says
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I did install other version of mysql and uninstalled earlier today. Any idea what to do here?
use lsof -i TCP:3306 to check which program binds port 3306
You could use netstat -lp | grep 3306 to find out what program is already listening on port 3306 (you should see PID/Program name in last column) and stop that (maybe mysql is already running?).
Alternatively you could start the newly installed server on a different port. (edit my.cnf and change the default port there)
Related
2021-04-27 21:04:35 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 10049: The requested address is invalid in this context.
2021-04-27 21:04:35 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2021-04-27 21:04:35 0 [ERROR] Aborting
I think you already have another service running on port 3306 and that is why MySQl cannot use it, so two solutions:
Change MySQL port editing mysql.ini (Usually located where MySQL is installed, like C:\Program Files\MySQL\MySQL Server 5.5\my.ini) and change the line port=3306 to use another port number
Identify what service is using that port and kill it:
Use nestat to identify the process is using the port 3306
netstat -aon | findstr 3306
The last column of the result is the process id (PID), use it to identify what application is blocking the port and with that information you can kill/uninstall the app is blocking MySQL.
tasklist | findstr <PID>
I hope this would be helpful.
I have encountered a strange error with MySQL service. I can not start it due to the problem related to ports. I have checked my error logs:
2021-03-18T10:02:22.507114Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address
2021-03-18T10:02:22.507246Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-03-18T10:02:22.508080Z 0 [ERROR] [MY-010119] [Server] Aborting
I have checked some other threads on StackOverflow about this issue, so I decided to try the solutions.
Another mysqld server running on port 3306 error
Do you already have another mysqld server running on port: 3306 Ubuntu
Mysql port already in use
I checked all my ports with:
netstat -tulpn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:12526 0.0.0.0:* LISTEN 485/sshd
tcp 0 232 172.16.2.34:12526 10.200.0.62:62217 ESTABLISHED 898/sshd: sop [priv
tcp6 0 0 :::80 :::* LISTEN 547/apache2
As you can see, there is nothing associated with port 3306.
To be sure, I checked that with:
lsof -i TCP:3306
I decided to try changing the port that MySQL uses. I opened the configuration file and changed the port to the different one that FOR SURE must be free (again, I checked that).
port = 6606
Unfortunately, it only resulted into changed error log:
2021-03-18T10:22:22.507114Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address
2021-03-18T10:22:22.507246Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 6606 ?
2021-03-18T12:02:22.508080Z 0 [ERROR] [MY-010119] [Server] Aborting
All solutions I have seen, require to kill the program that occupy the port, but how do I am supposed to do so when there is no such program? What else can I consider? I wonder if I will just end up with reinstalling MySQL, because I have no idea what to do with this error...
I would like to admit that MySQL has worked very well so far, and I cannot pinpoint why it suddenly stopped working properly. No significant changes have been made to the system. No services were installed that could started to use ports that MySQL wants to use.
I use MySQL on Linux Debian 10.
Thank you in advance for all your help and time. :)
Check the MySQL service status by running below command:
/etc/init.d/mysqld status
If MySQL service is running then stop the service by running below command
/etc/init.d/mysqld stop
Check if MySQL service port 3306 is still in use or not by running below command:
netstat -apn | grep 3306
If MySQL service is found running in step 3 then kill the service using below command:
kill -9 pid
Start the MySQL service using below command:
/etc/init.d/mysqld start
I had the same problem that port 3306 was not in use but I couldn't start mysql server.
I am first time istalling MySQL Cluster so I followed this guide: https://devops-fu.org/2018/08/13/how-to-install-mysql-ndb-cluster-ubuntu/
It came out that the mysql didn't have access to following folders:
/var/lib/mysql
/var/log/mysql
/var/run/mysql
Maybe I was running installation commands using wrong user account.
I had this problem on my local WampServer (in Windows 10), after hours of try to solve it, I found very simple solution!
Just open Task Manager by keeping "Ctrl" + "Alt" + "Delete" keys, then search for "mysqld.exe" process, right-click on it and click "End Task".
Restart the WampServer and enjoy it!
After more researches and efforts, I decided to fully reinstall MySQL service, because I did not find anything working. Now everything is working fine, but I hope that I will not encounter something hopelessly similar in the future.
Background: I'm using 2 nodes, one I'm calling services and one I'm calling storage. I'm using chef to provision the nodes and I'm using vagrant to virtualise the nodes. All passwords are virtualised local environments only, before people get upset
I've had it setup before where the storage node has been running MySQL and the services node has been running php and able to connect to the storage node.
Recently I've completely destroyed and uped the VMs again and the storage node is no longer accepting connections to MySQL from remote hosts
vagrant#services:~$ mysql -u web_app -ppassword -h 192.168.33.2
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.33.2' (111)
vagrant#storage:~$ mysql -u root -ppassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 46
Server version: 5.5.36-34.0-632.precise (Ubuntu)
I've setup my MySQL permissions as such http://pastie.org/pastes/8946859/text?key=xdtlskj5gwl5qypowcvpa
Following the advice given on a few other questions dotted around on the site
vagrant#storage:~$ less /etc/my.cnf | grep bind-address
bind-address = 0.0.0.0
vagrant#storage:~$ sudo netstat -lpn | grep 3306
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 6008/mysqld
This to me looks like MySQL is listening on address 0.0.0.0 on port 3306, which should be ok.
Really lost by this one, especially as I'm using chef and don't recall changing any config options since it last worked...
Solved my own problem to an extent. Just checked /etc/mysql/my.cnf and it looks like the bind address was set to 127.0.0.1
Have changed this to 0.0.0.0 restarted and the server and can now connect remotely
Just got to make this work with chef again...
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Every time I restart MySQL server
bitnami#xxx:/$ sudo opt/bitnami/ctlscript.sh start server
WWarning: World-writable config file '/opt/bitnami/mysql/my.cnf' is ignored
Warning: World-writable config file '/opt/bitnami/mysql/my.cnf' is ignored
121120 12:30:18 mysqld_safe Logging to '/opt/bitnami/mysql/data/mysqld.log'.
121120 12:30:18 mysqld_safe Starting mysqld daemon with databases from /opt/bitnami/mysql/data
121120 12:30:20 mysqld_safe mysqld from pid file /opt/bitnami/mysql/data/ip-10-136-14-170.pid ended
/opt/bitnami/mysql/scripts/ctl.sh : mysql could not be started
The server responds with the following error:
(2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")
Please tell me what I have to do fix this issue.
If mysql is installed as a service (which is most of the time) you can do service mysqld restart or /etc/init.d/mysqld restart.
You can also use start, stop or reload instead of restart.
I got the package postgresql-8.4.9.tar.bz2 on the postgresql website and installed it following the instructions on the file INSTALL. But when we try to run it, it doesn't work and throws this error:
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
LOG: could not bind IPv6 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: could not bind IPv4 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
WARNING: could not create listen socket for "localhost"
FATAL: could not create any TCP/IP sockets
I don't know, maybe it's because of some conflict with mysql. Does anybody know what's going on?
Thanks in advance!
It appears that another process is listening on port 5432. Try running the following command:
sudo netstat -tulpn | grep 5432