Override database option in a user-specific .my.cnf config file
Using MariaDB 10.2.15 (Linux Debian Stretch)
I have created a ~/.my.cnf config file in my home directory in order to set a default database at connection time for all local client tools:
[client]
user=myuser
password=mySecretPassword
database=mydb
But I want to unset (skip) option database for a specific client program (mysqldump). This is to prevent such warning when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
I was hoping using skip-OPTIONNAME in a [mysqldump] section would have worked, but unfortunately it doesn't.
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
skip-database
In fact, I noticed that database is multi-value. So overriding it is not really possible. For example, the following .my.cnf config file:
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
database=mydb2
produces 2 warnings when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb2'
Is there a way to "unset" option database in an overridden section?
mariadb my.cnf
bumped to the homepage by Community♦ 18 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 |
Using MariaDB 10.2.15 (Linux Debian Stretch)
I have created a ~/.my.cnf config file in my home directory in order to set a default database at connection time for all local client tools:
[client]
user=myuser
password=mySecretPassword
database=mydb
But I want to unset (skip) option database for a specific client program (mysqldump). This is to prevent such warning when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
I was hoping using skip-OPTIONNAME in a [mysqldump] section would have worked, but unfortunately it doesn't.
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
skip-database
In fact, I noticed that database is multi-value. So overriding it is not really possible. For example, the following .my.cnf config file:
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
database=mydb2
produces 2 warnings when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb2'
Is there a way to "unset" option database in an overridden section?
mariadb my.cnf
bumped to the homepage by Community♦ 18 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Does it work/help to have a linedatabase=in the 'mysqldump' section?
– dbdemon
Jun 30 '18 at 15:43
Thanks @dbdemon, I trieddatabase=(empty value) but it does not help.
– Nicolas Payart
Jul 2 '18 at 8:09
add a comment |
Using MariaDB 10.2.15 (Linux Debian Stretch)
I have created a ~/.my.cnf config file in my home directory in order to set a default database at connection time for all local client tools:
[client]
user=myuser
password=mySecretPassword
database=mydb
But I want to unset (skip) option database for a specific client program (mysqldump). This is to prevent such warning when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
I was hoping using skip-OPTIONNAME in a [mysqldump] section would have worked, but unfortunately it doesn't.
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
skip-database
In fact, I noticed that database is multi-value. So overriding it is not really possible. For example, the following .my.cnf config file:
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
database=mydb2
produces 2 warnings when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb2'
Is there a way to "unset" option database in an overridden section?
mariadb my.cnf
Using MariaDB 10.2.15 (Linux Debian Stretch)
I have created a ~/.my.cnf config file in my home directory in order to set a default database at connection time for all local client tools:
[client]
user=myuser
password=mySecretPassword
database=mydb
But I want to unset (skip) option database for a specific client program (mysqldump). This is to prevent such warning when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
I was hoping using skip-OPTIONNAME in a [mysqldump] section would have worked, but unfortunately it doesn't.
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
skip-database
In fact, I noticed that database is multi-value. So overriding it is not really possible. For example, the following .my.cnf config file:
[client]
user=myuser
password=mySecretPassword
database=mydb
[mysqldump]
database=mydb2
produces 2 warnings when running mysqldump:
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb'
Warning: /usr/bin/mysqldump: ignoring option '--databases' due to
invalid value 'mydb2'
Is there a way to "unset" option database in an overridden section?
mariadb my.cnf
mariadb my.cnf
asked Jun 29 '18 at 8:31
Nicolas PayartNicolas Payart
68531027
68531027
bumped to the homepage by Community♦ 18 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♦ 18 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Does it work/help to have a linedatabase=in the 'mysqldump' section?
– dbdemon
Jun 30 '18 at 15:43
Thanks @dbdemon, I trieddatabase=(empty value) but it does not help.
– Nicolas Payart
Jul 2 '18 at 8:09
add a comment |
Does it work/help to have a linedatabase=in the 'mysqldump' section?
– dbdemon
Jun 30 '18 at 15:43
Thanks @dbdemon, I trieddatabase=(empty value) but it does not help.
– Nicolas Payart
Jul 2 '18 at 8:09
Does it work/help to have a line
database= in the 'mysqldump' section?– dbdemon
Jun 30 '18 at 15:43
Does it work/help to have a line
database= in the 'mysqldump' section?– dbdemon
Jun 30 '18 at 15:43
Thanks @dbdemon, I tried
database= (empty value) but it does not help.– Nicolas Payart
Jul 2 '18 at 8:09
Thanks @dbdemon, I tried
database= (empty value) but it does not help.– Nicolas Payart
Jul 2 '18 at 8:09
add a comment |
1 Answer
1
active
oldest
votes
In fact I am realizing that setting database option in a [client] section is may be nonsense as many client tools won't be compatible.
mysqldump and mysql_upgrade for example are complaining about this option. So I may specify it in a more specific [mysql] section instead:
[client]
user=myuser
password=mySecretPassword
[mysql]
database=mydb
Even if it meets my needs, It would still be great to find a way to override database option though...
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%2f210944%2foverride-database-option-in-a-user-specific-my-cnf-config-file%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
In fact I am realizing that setting database option in a [client] section is may be nonsense as many client tools won't be compatible.
mysqldump and mysql_upgrade for example are complaining about this option. So I may specify it in a more specific [mysql] section instead:
[client]
user=myuser
password=mySecretPassword
[mysql]
database=mydb
Even if it meets my needs, It would still be great to find a way to override database option though...
add a comment |
In fact I am realizing that setting database option in a [client] section is may be nonsense as many client tools won't be compatible.
mysqldump and mysql_upgrade for example are complaining about this option. So I may specify it in a more specific [mysql] section instead:
[client]
user=myuser
password=mySecretPassword
[mysql]
database=mydb
Even if it meets my needs, It would still be great to find a way to override database option though...
add a comment |
In fact I am realizing that setting database option in a [client] section is may be nonsense as many client tools won't be compatible.
mysqldump and mysql_upgrade for example are complaining about this option. So I may specify it in a more specific [mysql] section instead:
[client]
user=myuser
password=mySecretPassword
[mysql]
database=mydb
Even if it meets my needs, It would still be great to find a way to override database option though...
In fact I am realizing that setting database option in a [client] section is may be nonsense as many client tools won't be compatible.
mysqldump and mysql_upgrade for example are complaining about this option. So I may specify it in a more specific [mysql] section instead:
[client]
user=myuser
password=mySecretPassword
[mysql]
database=mydb
Even if it meets my needs, It would still be great to find a way to override database option though...
answered Jul 2 '18 at 8:17
Nicolas PayartNicolas Payart
68531027
68531027
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%2f210944%2foverride-database-option-in-a-user-specific-my-cnf-config-file%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
Does it work/help to have a line
database=in the 'mysqldump' section?– dbdemon
Jun 30 '18 at 15:43
Thanks @dbdemon, I tried
database=(empty value) but it does not help.– Nicolas Payart
Jul 2 '18 at 8:09