Why does mysql server not accept nonlocal connection request, but still listen on a tcp port?
A mysql server with default settings is listening on a port on a machine:
$ nmap -p0-65535 192.168.1.97
Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-20 14:34 EDT
Nmap scan report for ocean.fios-router.home (192.168.1.97)
Host is up (0.00036s latency).
Not shown: 65533 closed ports
PORT STATE SERVICE
22/tcp open ssh
3306/tcp open mysql
33060/tcp open mysqlx
Nmap done: 1 IP address (1 host up) scanned in 4.50 seconds
I can't connect to the mysql server from another machine:
$ mysql --user=root --host=ocean --password test
Enter password:
ERROR 1130 (HY000): Host 'olive.fios-router.home' is not allowed to connect to this MySQL server
How shall I understand the two contradictory results?
Did mysql server receive the connection request, but then refuses it?
If it doesn't accept nonlocal connection request, why does it listen on a tcp port?
Thanks.
mysql
add a comment |
A mysql server with default settings is listening on a port on a machine:
$ nmap -p0-65535 192.168.1.97
Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-20 14:34 EDT
Nmap scan report for ocean.fios-router.home (192.168.1.97)
Host is up (0.00036s latency).
Not shown: 65533 closed ports
PORT STATE SERVICE
22/tcp open ssh
3306/tcp open mysql
33060/tcp open mysqlx
Nmap done: 1 IP address (1 host up) scanned in 4.50 seconds
I can't connect to the mysql server from another machine:
$ mysql --user=root --host=ocean --password test
Enter password:
ERROR 1130 (HY000): Host 'olive.fios-router.home' is not allowed to connect to this MySQL server
How shall I understand the two contradictory results?
Did mysql server receive the connection request, but then refuses it?
If it doesn't accept nonlocal connection request, why does it listen on a tcp port?
Thanks.
mysql
1
Possible duplicate of Why is mysql server accepting nonlocal request, while postgresql server is not?
– nwildner
6 hours ago
add a comment |
A mysql server with default settings is listening on a port on a machine:
$ nmap -p0-65535 192.168.1.97
Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-20 14:34 EDT
Nmap scan report for ocean.fios-router.home (192.168.1.97)
Host is up (0.00036s latency).
Not shown: 65533 closed ports
PORT STATE SERVICE
22/tcp open ssh
3306/tcp open mysql
33060/tcp open mysqlx
Nmap done: 1 IP address (1 host up) scanned in 4.50 seconds
I can't connect to the mysql server from another machine:
$ mysql --user=root --host=ocean --password test
Enter password:
ERROR 1130 (HY000): Host 'olive.fios-router.home' is not allowed to connect to this MySQL server
How shall I understand the two contradictory results?
Did mysql server receive the connection request, but then refuses it?
If it doesn't accept nonlocal connection request, why does it listen on a tcp port?
Thanks.
mysql
A mysql server with default settings is listening on a port on a machine:
$ nmap -p0-65535 192.168.1.97
Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-20 14:34 EDT
Nmap scan report for ocean.fios-router.home (192.168.1.97)
Host is up (0.00036s latency).
Not shown: 65533 closed ports
PORT STATE SERVICE
22/tcp open ssh
3306/tcp open mysql
33060/tcp open mysqlx
Nmap done: 1 IP address (1 host up) scanned in 4.50 seconds
I can't connect to the mysql server from another machine:
$ mysql --user=root --host=ocean --password test
Enter password:
ERROR 1130 (HY000): Host 'olive.fios-router.home' is not allowed to connect to this MySQL server
How shall I understand the two contradictory results?
Did mysql server receive the connection request, but then refuses it?
If it doesn't accept nonlocal connection request, why does it listen on a tcp port?
Thanks.
mysql
mysql
asked 6 hours ago
TimTim
27.9k78269486
27.9k78269486
1
Possible duplicate of Why is mysql server accepting nonlocal request, while postgresql server is not?
– nwildner
6 hours ago
add a comment |
1
Possible duplicate of Why is mysql server accepting nonlocal request, while postgresql server is not?
– nwildner
6 hours ago
1
1
Possible duplicate of Why is mysql server accepting nonlocal request, while postgresql server is not?
– nwildner
6 hours ago
Possible duplicate of Why is mysql server accepting nonlocal request, while postgresql server is not?
– nwildner
6 hours ago
add a comment |
2 Answers
2
active
oldest
votes
Well, it seems that you have duplicated your question instead of editing the original one.
If you have edited bind-address
as said at the other question, your service should not listen to other ip address than the one configured on that parameter.
Second, you are not allowed to connect to this server because you need to also provide access at the application level of MySQL.
At the local shell of that remote server, access your mysql
prompt and execute the following
`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';`
You seem to be missing 2 basic things at MySQL: network configuration and application level authorization/permission. I suggest you to study that technology further.
Google it further by ERROR 1130 (HY000): Host is not allowed
. You will be surprised that the FIRST RESULT of that search will also lead you to StackExchange. Here: ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server [duplicate]
Thanks. If it doesn't accept nonlocal connection request in terms of application level authorization/permission, why does it listen on a tcp port?
– Tim
6 hours ago
Cause to make it listen to other addresses than0.0.0.0
(all addresses at all interfaces) you need to edit yourmy.cnf
file and configure it no NOT LISTEN to all existing addresses you have. I have already answered that at the other question, and even explained WHY this behavior exists. Take your time to read it carefully
– nwildner
5 hours ago
Maybe I wasn't clear. If mysql server doesn't grant application level authorization/permission to nonlocal authentication request, why does it bother to listen at a TCP port?
– Tim
5 hours ago
Cause, again, you need to configure yourmy.cnf
to bind ONLY no localhost ip address(127.0.0.1
). Otherwise, it will bind to ALL existing IP addresses of your computer....
– nwildner
5 hours ago
add a comment |
That's because what MySQL does consider as a users. In MySQL You grant privileges to user+host combination written as user@host
.
Following each of following examples are is different
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'%';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'localhost';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'192.168.1.97';
Each user+host combination can have a different password (… if append IDENTIFIED BY 'your-password';
You can find more examples and better description in MySQL GRANT documentation
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507548%2fwhy-does-mysql-server-not-accept-nonlocal-connection-request-but-still-listen-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Well, it seems that you have duplicated your question instead of editing the original one.
If you have edited bind-address
as said at the other question, your service should not listen to other ip address than the one configured on that parameter.
Second, you are not allowed to connect to this server because you need to also provide access at the application level of MySQL.
At the local shell of that remote server, access your mysql
prompt and execute the following
`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';`
You seem to be missing 2 basic things at MySQL: network configuration and application level authorization/permission. I suggest you to study that technology further.
Google it further by ERROR 1130 (HY000): Host is not allowed
. You will be surprised that the FIRST RESULT of that search will also lead you to StackExchange. Here: ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server [duplicate]
Thanks. If it doesn't accept nonlocal connection request in terms of application level authorization/permission, why does it listen on a tcp port?
– Tim
6 hours ago
Cause to make it listen to other addresses than0.0.0.0
(all addresses at all interfaces) you need to edit yourmy.cnf
file and configure it no NOT LISTEN to all existing addresses you have. I have already answered that at the other question, and even explained WHY this behavior exists. Take your time to read it carefully
– nwildner
5 hours ago
Maybe I wasn't clear. If mysql server doesn't grant application level authorization/permission to nonlocal authentication request, why does it bother to listen at a TCP port?
– Tim
5 hours ago
Cause, again, you need to configure yourmy.cnf
to bind ONLY no localhost ip address(127.0.0.1
). Otherwise, it will bind to ALL existing IP addresses of your computer....
– nwildner
5 hours ago
add a comment |
Well, it seems that you have duplicated your question instead of editing the original one.
If you have edited bind-address
as said at the other question, your service should not listen to other ip address than the one configured on that parameter.
Second, you are not allowed to connect to this server because you need to also provide access at the application level of MySQL.
At the local shell of that remote server, access your mysql
prompt and execute the following
`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';`
You seem to be missing 2 basic things at MySQL: network configuration and application level authorization/permission. I suggest you to study that technology further.
Google it further by ERROR 1130 (HY000): Host is not allowed
. You will be surprised that the FIRST RESULT of that search will also lead you to StackExchange. Here: ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server [duplicate]
Thanks. If it doesn't accept nonlocal connection request in terms of application level authorization/permission, why does it listen on a tcp port?
– Tim
6 hours ago
Cause to make it listen to other addresses than0.0.0.0
(all addresses at all interfaces) you need to edit yourmy.cnf
file and configure it no NOT LISTEN to all existing addresses you have. I have already answered that at the other question, and even explained WHY this behavior exists. Take your time to read it carefully
– nwildner
5 hours ago
Maybe I wasn't clear. If mysql server doesn't grant application level authorization/permission to nonlocal authentication request, why does it bother to listen at a TCP port?
– Tim
5 hours ago
Cause, again, you need to configure yourmy.cnf
to bind ONLY no localhost ip address(127.0.0.1
). Otherwise, it will bind to ALL existing IP addresses of your computer....
– nwildner
5 hours ago
add a comment |
Well, it seems that you have duplicated your question instead of editing the original one.
If you have edited bind-address
as said at the other question, your service should not listen to other ip address than the one configured on that parameter.
Second, you are not allowed to connect to this server because you need to also provide access at the application level of MySQL.
At the local shell of that remote server, access your mysql
prompt and execute the following
`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';`
You seem to be missing 2 basic things at MySQL: network configuration and application level authorization/permission. I suggest you to study that technology further.
Google it further by ERROR 1130 (HY000): Host is not allowed
. You will be surprised that the FIRST RESULT of that search will also lead you to StackExchange. Here: ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server [duplicate]
Well, it seems that you have duplicated your question instead of editing the original one.
If you have edited bind-address
as said at the other question, your service should not listen to other ip address than the one configured on that parameter.
Second, you are not allowed to connect to this server because you need to also provide access at the application level of MySQL.
At the local shell of that remote server, access your mysql
prompt and execute the following
`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';`
You seem to be missing 2 basic things at MySQL: network configuration and application level authorization/permission. I suggest you to study that technology further.
Google it further by ERROR 1130 (HY000): Host is not allowed
. You will be surprised that the FIRST RESULT of that search will also lead you to StackExchange. Here: ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server [duplicate]
answered 6 hours ago
nwildnernwildner
14.8k34380
14.8k34380
Thanks. If it doesn't accept nonlocal connection request in terms of application level authorization/permission, why does it listen on a tcp port?
– Tim
6 hours ago
Cause to make it listen to other addresses than0.0.0.0
(all addresses at all interfaces) you need to edit yourmy.cnf
file and configure it no NOT LISTEN to all existing addresses you have. I have already answered that at the other question, and even explained WHY this behavior exists. Take your time to read it carefully
– nwildner
5 hours ago
Maybe I wasn't clear. If mysql server doesn't grant application level authorization/permission to nonlocal authentication request, why does it bother to listen at a TCP port?
– Tim
5 hours ago
Cause, again, you need to configure yourmy.cnf
to bind ONLY no localhost ip address(127.0.0.1
). Otherwise, it will bind to ALL existing IP addresses of your computer....
– nwildner
5 hours ago
add a comment |
Thanks. If it doesn't accept nonlocal connection request in terms of application level authorization/permission, why does it listen on a tcp port?
– Tim
6 hours ago
Cause to make it listen to other addresses than0.0.0.0
(all addresses at all interfaces) you need to edit yourmy.cnf
file and configure it no NOT LISTEN to all existing addresses you have. I have already answered that at the other question, and even explained WHY this behavior exists. Take your time to read it carefully
– nwildner
5 hours ago
Maybe I wasn't clear. If mysql server doesn't grant application level authorization/permission to nonlocal authentication request, why does it bother to listen at a TCP port?
– Tim
5 hours ago
Cause, again, you need to configure yourmy.cnf
to bind ONLY no localhost ip address(127.0.0.1
). Otherwise, it will bind to ALL existing IP addresses of your computer....
– nwildner
5 hours ago
Thanks. If it doesn't accept nonlocal connection request in terms of application level authorization/permission, why does it listen on a tcp port?
– Tim
6 hours ago
Thanks. If it doesn't accept nonlocal connection request in terms of application level authorization/permission, why does it listen on a tcp port?
– Tim
6 hours ago
Cause to make it listen to other addresses than
0.0.0.0
(all addresses at all interfaces) you need to edit your my.cnf
file and configure it no NOT LISTEN to all existing addresses you have. I have already answered that at the other question, and even explained WHY this behavior exists. Take your time to read it carefully– nwildner
5 hours ago
Cause to make it listen to other addresses than
0.0.0.0
(all addresses at all interfaces) you need to edit your my.cnf
file and configure it no NOT LISTEN to all existing addresses you have. I have already answered that at the other question, and even explained WHY this behavior exists. Take your time to read it carefully– nwildner
5 hours ago
Maybe I wasn't clear. If mysql server doesn't grant application level authorization/permission to nonlocal authentication request, why does it bother to listen at a TCP port?
– Tim
5 hours ago
Maybe I wasn't clear. If mysql server doesn't grant application level authorization/permission to nonlocal authentication request, why does it bother to listen at a TCP port?
– Tim
5 hours ago
Cause, again, you need to configure your
my.cnf
to bind ONLY no localhost ip address(127.0.0.1
). Otherwise, it will bind to ALL existing IP addresses of your computer....– nwildner
5 hours ago
Cause, again, you need to configure your
my.cnf
to bind ONLY no localhost ip address(127.0.0.1
). Otherwise, it will bind to ALL existing IP addresses of your computer....– nwildner
5 hours ago
add a comment |
That's because what MySQL does consider as a users. In MySQL You grant privileges to user+host combination written as user@host
.
Following each of following examples are is different
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'%';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'localhost';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'192.168.1.97';
Each user+host combination can have a different password (… if append IDENTIFIED BY 'your-password';
You can find more examples and better description in MySQL GRANT documentation
add a comment |
That's because what MySQL does consider as a users. In MySQL You grant privileges to user+host combination written as user@host
.
Following each of following examples are is different
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'%';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'localhost';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'192.168.1.97';
Each user+host combination can have a different password (… if append IDENTIFIED BY 'your-password';
You can find more examples and better description in MySQL GRANT documentation
add a comment |
That's because what MySQL does consider as a users. In MySQL You grant privileges to user+host combination written as user@host
.
Following each of following examples are is different
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'%';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'localhost';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'192.168.1.97';
Each user+host combination can have a different password (… if append IDENTIFIED BY 'your-password';
You can find more examples and better description in MySQL GRANT documentation
That's because what MySQL does consider as a users. In MySQL You grant privileges to user+host combination written as user@host
.
Following each of following examples are is different
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'%';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'localhost';
GRANT ALL PRIVILEGES ON db.* TO 'user1'@'192.168.1.97';
Each user+host combination can have a different password (… if append IDENTIFIED BY 'your-password';
You can find more examples and better description in MySQL GRANT documentation
answered 6 hours ago
Jakub JindraJakub Jindra
354310
354310
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507548%2fwhy-does-mysql-server-not-accept-nonlocal-connection-request-but-still-listen-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Possible duplicate of Why is mysql server accepting nonlocal request, while postgresql server is not?
– nwildner
6 hours ago