Can't start MySQL Server with XAMPP - mysql

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.

Related

Remote user is not able to connect to mariadb

MariaDB is installed on server with IP 1.2.3.4, new MySQL user has been created on 1.2.3.4 for remote IP a.b.c.d, but while trying to connect MySQL on 1.2.3.4 from a.b.c.d giving error:
ERROR 2003 (HY000): Can't connect to MySQL server on '1.2.3.4' (111
"Connection refused")
Investigation-:
trying to telnet from a.b.c.d to 1.2.3.4 at port 3306 also not working
surprisingly when trying to connect mysql from 1.2.3.4 directly using server IP 1.2.3.4 is also throwing error "ERROR 2003 (HY000): Can't connect to MySQL server on '1.2.3.4' (111)
While trying to connect mysql using mysql -h localhost -u root -p is successfully working.
What we are looking for, we want to connect mysql from a.b.c.d to 1.2.3.4, please suggest what we are missing.
addtional information:
on server 1.2.3.4 /etc/mysql/my.cnf is not present, there exist '/etc/my.cnf'
trying to find solution we are referring link "webdock.io/en/docs/how-guides/database-guides/…" some edit is mentioned to in file "/etc/mysql/my.cnf" which is not present.
Added from comment below
Firewall has been disabled, user has already created, mariadb.log showing error while binding
221215 17:10:12 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 99: Cannot assign requested address
221215 17:10:12 [ERROR] Do you already have another mysqld server running on port: 3306 ?
221215 17:10:12 [ERROR] Aborting
Some points to consider.
Check firewall (port 3306 should be allowed for the remote ip if you are running MariaDB on 3306 port )
The user should exists (which you have) and it should be something like;
user#your_remote_ip
Check bind-address in the configuration file, if it set to 127.0.0.1 it will allow only localhost login.
It is a good idea to check the logs , usually located on /var/log/mysql/ or you could verify from the configuration file where the logs are located
log_error = /var/log/mysql/error.log
Most probably it might be a firewall issue.
Make sure that the port on which the database server is running is not closed and is exposed publicly.
Also check if the database configurations allow binding IP is not only set to 127.0.0.1 but every IP can bind.

How to fix: MySQL can not start: Error "another mysqld server running on port: 3306?" - checked port and it is FREE

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.

How to log in mysql DB in remote host [duplicate]

Server ip: 172.16.1.169
mysql user name: root
passwd: xxxxxxxxxx
database name: example
I'm trying to access a database from a client (ip 172.16.0.114). Both the server and client are running the Fedora distribution of Linux. What settings need to be configured, and what should they be set to, for both the server and client? How do I access a specific database (here, "example")? I tried but I got an error:
ERROR 2003 (HY000): Can't connect to MySQL server on '172.16.1.169'.
That error message is generated by the client (not the server) because a connection to the server has been attempted but the server could not be reached.
There are various possible causes to that:
1) check that mysqld is running on the server:
ps -ef | grep mysqld
should return something like:
root 2435 2342 0 15:49 pts/1 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/var/ --user=mysql
mysql 2480 2435 0 15:49 pts/1 00:00:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/var/ --user=mysql ...
To run the daemon service, run on redhat/fedora/centos:
service mysqld start
or on Fedora release >= 16, which relies on systemd:
systemctl start mysqld.service
and for enabling daemon auto-startup at system boot:
systemctl enable mysqld.service
2) check the port on which mysqld is running on the server:
netstat -lnp | grep mysql
should return:
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2480/mysqld
unix 2 [ ACC ] STREAM LISTENING 8101 2480/mysqld /tmp/mysql.sock
the latter is the socket for local connections, the first the tcp port for networking (default 3306). If the port is not the default port, you must set the connection port on the client. If using mysql client:
mysql dbname -uuser -ppasswd -P<port> ...
3) being on a different net address, check that the server listens for the net addrees your are connecting from: in file /etc/my.cnf search for the line:
bind_address=127.0.0.1
if the address is 127.0.0.1 only local connections are allowed; if it were 172.16.1.0, you could not connect from 172.16.2.xxx
4) check that on the server there is no firewall running and blocking connections to mysql port (3306 is the default port); if it's a redhat/fedora/centos run
service iptables status
Open MySQL config file
sudo vim my.cnf
Ensure that the following are commented out.
#skip-external-locking
#skip-networking
#bind-address = xx.xx.xx.xx
Save and exit
Restart mysql service
In MySQL config file (/etc/mysql/my.cnf) comment '#bind-address = 127.0.0.1'
Save and restart mysql service.
I think the destination mysql server might use a different port.
You have to find the correct port first.
Once you get the correct port you can connect to that mysql server by using this command:
mysql -h 172.16.1.169 -P (port) -u root -p (password)

MySQL server remote connection?

I am trying to setup MySql 5.5 server for remote access from Ubuntu host 192.168.1.139, so
I added line: bind-address=192.168.1.139 to the server's config file: /etc/mysql/my.cf
When i tried to restart mysqld, i've got the following error:
[Note] Server hostname (bind-address): '192.168.1.139'; port: 3306
[Note] - '192.168.1.139' resolves to '192.168.1.139';
[Note] Server socket created on IP: '192.168.1.139'.
[ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
[ERROR] Do you already have another mysqld server running on port: 3306 ?
Can anyone help with the problem cause? And how can i open MySQL server for connection from any host/user , e.g. what should be the syntax for that in my.cf?
bind-address is for your local IP addresses or network interfaces. You cannot bind to a remote address. You'll need to set up rules in a firewall in order to do such limitations. Run ifconfig to see what are your network interfaces. Use
bind-address = 0.0.0.0
to allow connections to any interface. I recommend you this post https://serverfault.com/a/139326
I think this message
[ERROR] Do you already have another mysqld server running on port: 3306 ?
can be pretty misleading as this can also be related to the binding address and not the port itsel.
In my case, the database failed to start on system init because I was binding to the 10.0.0.11 IP address, whose interface wasn't ready on startup. To solve it (on MariaDB/Fedora 24):
mkdir /lib/systemd/system/mariadb.service.d
echo "[Unit]
After=network-online.target
Wants=network-online.target
" > /lib/systemd/system/mariadb.service.d/waitForNetwork.conf

Another mysqld server running on port 3306 error [closed]

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)