Which one for MySql Bind addresss 127.0.0.1 (in apache & ubuntu)
Should I set the bind address 127.0.0.1 in
etc/mysql/my.cnf
or
/etc/mysql/mysql.conf.d/mysqld.cnf
I am using
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
mysql phpmyadmin
bumped to the homepage by Community♦ 14 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Should I set the bind address 127.0.0.1 in
etc/mysql/my.cnf
or
/etc/mysql/mysql.conf.d/mysqld.cnf
I am using
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
mysql phpmyadmin
bumped to the homepage by Community♦ 14 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
What version of MySQL are you using?
– hot2use
Jan 9 '18 at 12:15
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
----mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
– Mark178
Jan 9 '18 at 12:19
add a comment |
Should I set the bind address 127.0.0.1 in
etc/mysql/my.cnf
or
/etc/mysql/mysql.conf.d/mysqld.cnf
I am using
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
mysql phpmyadmin
Should I set the bind address 127.0.0.1 in
etc/mysql/my.cnf
or
/etc/mysql/mysql.conf.d/mysqld.cnf
I am using
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
mysql phpmyadmin
mysql phpmyadmin
edited Jan 9 '18 at 12:23
Mark178
asked Jan 9 '18 at 11:56
Mark178Mark178
11
11
bumped to the homepage by Community♦ 14 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 14 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
What version of MySQL are you using?
– hot2use
Jan 9 '18 at 12:15
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
----mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
– Mark178
Jan 9 '18 at 12:19
add a comment |
What version of MySQL are you using?
– hot2use
Jan 9 '18 at 12:15
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
----mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
– Mark178
Jan 9 '18 at 12:19
What version of MySQL are you using?
– hot2use
Jan 9 '18 at 12:15
What version of MySQL are you using?
– hot2use
Jan 9 '18 at 12:15
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
---- mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
– Mark178
Jan 9 '18 at 12:19
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
---- mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
– Mark178
Jan 9 '18 at 12:19
add a comment |
1 Answer
1
active
oldest
votes
Many Linux distributions source the contents of /etc/mysql/conf.d
after reading /etc/mysql/my.cnf
, so that the package maintainer can make whatever changes they want to my.cnf and the system administrator can keep only their customizations in the conf.d directory, which makes upgrades much easier.
However, quoting straight out of my /etc/mysql/my.cnf
file provided by Debian Linux (I've got MariaDB, but Debian policy handles it the same way as they would have MySQL):
The MariaDB/MySQL tools read configuration files in the following order:
- "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
- "/etc/mysql/conf.d/*.cnf" to set global options.
- "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
- "~/.my.cnf" to set user-specific options.
On my system, the default bind-address is set in /etc/mysql/mariadb.conf.d/50-server.cnf
which would be read after my customized setting in /etc/mysq/conf.d/isaacs_totally_great_customizations.cnf
, and override my setting from there — I'd have to set it in the mariadb.conf.d folder. You don't say which distribution you're using, but you should look in /etc/mysq/my.cnf
for some hints about the order of loading. At the end, you'll probably see a line like !includedir /etc/mysql/mysql.conf.d/
which will show you which folder is loaded last.
My opinion is that, if the conf.d directory is loaded last, that's the "best" place to put it and least likely to be affected by your next upgrade. Of course, the simplest solution would be to just make your bind-address statement the last line of my.cnf which would pretty simply solve the problem without any lingering doubts.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
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%2fdba.stackexchange.com%2fquestions%2f194972%2fwhich-one-for-mysql-bind-addresss-127-0-0-1-in-apache-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Many Linux distributions source the contents of /etc/mysql/conf.d
after reading /etc/mysql/my.cnf
, so that the package maintainer can make whatever changes they want to my.cnf and the system administrator can keep only their customizations in the conf.d directory, which makes upgrades much easier.
However, quoting straight out of my /etc/mysql/my.cnf
file provided by Debian Linux (I've got MariaDB, but Debian policy handles it the same way as they would have MySQL):
The MariaDB/MySQL tools read configuration files in the following order:
- "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
- "/etc/mysql/conf.d/*.cnf" to set global options.
- "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
- "~/.my.cnf" to set user-specific options.
On my system, the default bind-address is set in /etc/mysql/mariadb.conf.d/50-server.cnf
which would be read after my customized setting in /etc/mysq/conf.d/isaacs_totally_great_customizations.cnf
, and override my setting from there — I'd have to set it in the mariadb.conf.d folder. You don't say which distribution you're using, but you should look in /etc/mysq/my.cnf
for some hints about the order of loading. At the end, you'll probably see a line like !includedir /etc/mysql/mysql.conf.d/
which will show you which folder is loaded last.
My opinion is that, if the conf.d directory is loaded last, that's the "best" place to put it and least likely to be affected by your next upgrade. Of course, the simplest solution would be to just make your bind-address statement the last line of my.cnf which would pretty simply solve the problem without any lingering doubts.
add a comment |
Many Linux distributions source the contents of /etc/mysql/conf.d
after reading /etc/mysql/my.cnf
, so that the package maintainer can make whatever changes they want to my.cnf and the system administrator can keep only their customizations in the conf.d directory, which makes upgrades much easier.
However, quoting straight out of my /etc/mysql/my.cnf
file provided by Debian Linux (I've got MariaDB, but Debian policy handles it the same way as they would have MySQL):
The MariaDB/MySQL tools read configuration files in the following order:
- "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
- "/etc/mysql/conf.d/*.cnf" to set global options.
- "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
- "~/.my.cnf" to set user-specific options.
On my system, the default bind-address is set in /etc/mysql/mariadb.conf.d/50-server.cnf
which would be read after my customized setting in /etc/mysq/conf.d/isaacs_totally_great_customizations.cnf
, and override my setting from there — I'd have to set it in the mariadb.conf.d folder. You don't say which distribution you're using, but you should look in /etc/mysq/my.cnf
for some hints about the order of loading. At the end, you'll probably see a line like !includedir /etc/mysql/mysql.conf.d/
which will show you which folder is loaded last.
My opinion is that, if the conf.d directory is loaded last, that's the "best" place to put it and least likely to be affected by your next upgrade. Of course, the simplest solution would be to just make your bind-address statement the last line of my.cnf which would pretty simply solve the problem without any lingering doubts.
add a comment |
Many Linux distributions source the contents of /etc/mysql/conf.d
after reading /etc/mysql/my.cnf
, so that the package maintainer can make whatever changes they want to my.cnf and the system administrator can keep only their customizations in the conf.d directory, which makes upgrades much easier.
However, quoting straight out of my /etc/mysql/my.cnf
file provided by Debian Linux (I've got MariaDB, but Debian policy handles it the same way as they would have MySQL):
The MariaDB/MySQL tools read configuration files in the following order:
- "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
- "/etc/mysql/conf.d/*.cnf" to set global options.
- "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
- "~/.my.cnf" to set user-specific options.
On my system, the default bind-address is set in /etc/mysql/mariadb.conf.d/50-server.cnf
which would be read after my customized setting in /etc/mysq/conf.d/isaacs_totally_great_customizations.cnf
, and override my setting from there — I'd have to set it in the mariadb.conf.d folder. You don't say which distribution you're using, but you should look in /etc/mysq/my.cnf
for some hints about the order of loading. At the end, you'll probably see a line like !includedir /etc/mysql/mysql.conf.d/
which will show you which folder is loaded last.
My opinion is that, if the conf.d directory is loaded last, that's the "best" place to put it and least likely to be affected by your next upgrade. Of course, the simplest solution would be to just make your bind-address statement the last line of my.cnf which would pretty simply solve the problem without any lingering doubts.
Many Linux distributions source the contents of /etc/mysql/conf.d
after reading /etc/mysql/my.cnf
, so that the package maintainer can make whatever changes they want to my.cnf and the system administrator can keep only their customizations in the conf.d directory, which makes upgrades much easier.
However, quoting straight out of my /etc/mysql/my.cnf
file provided by Debian Linux (I've got MariaDB, but Debian policy handles it the same way as they would have MySQL):
The MariaDB/MySQL tools read configuration files in the following order:
- "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
- "/etc/mysql/conf.d/*.cnf" to set global options.
- "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
- "~/.my.cnf" to set user-specific options.
On my system, the default bind-address is set in /etc/mysql/mariadb.conf.d/50-server.cnf
which would be read after my customized setting in /etc/mysq/conf.d/isaacs_totally_great_customizations.cnf
, and override my setting from there — I'd have to set it in the mariadb.conf.d folder. You don't say which distribution you're using, but you should look in /etc/mysq/my.cnf
for some hints about the order of loading. At the end, you'll probably see a line like !includedir /etc/mysql/mysql.conf.d/
which will show you which folder is loaded last.
My opinion is that, if the conf.d directory is loaded last, that's the "best" place to put it and least likely to be affected by your next upgrade. Of course, the simplest solution would be to just make your bind-address statement the last line of my.cnf which would pretty simply solve the problem without any lingering doubts.
answered Jan 11 '18 at 2:37
ibennetchibennetch
45826
45826
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators 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%2fdba.stackexchange.com%2fquestions%2f194972%2fwhich-one-for-mysql-bind-addresss-127-0-0-1-in-apache-ubuntu%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
What version of MySQL are you using?
– hot2use
Jan 9 '18 at 12:15
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64)
----mysqladmin Ver 8.42 Distrib 5.7.20, for Linux on x86_64
– Mark178
Jan 9 '18 at 12:19