remote mysql login using username / password not working when adding password to command line ...
Why is the maximum length of OpenWrt’s root password 8 characters?
What is this sharp, curved notch on my knife for?
What force causes entropy to increase?
Can a flute soloist sit?
How can I define good in a religion that claims no moral authority?
If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?
Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?
Cooking pasta in a water boiler
Is it safe to harvest rainwater that fell on solar panels?
Getting crown tickets for Statue of Liberty
Why are there uneven bright areas in this photo of black hole?
How do I free up internal storage if I don't have any apps downloaded?
Is bread bad for ducks?
Deal with toxic manager when you can't quit
The difference between dialogue marks
For what reasons would an animal species NOT cross a *horizontal* land bridge?
How to type a long/em dash `—`
Can withdrawing asylum be illegal?
Why didn't the Event Horizon Telescope team mention Sagittarius A*?
Does adding complexity mean a more secure cipher?
How to charge AirPods to keep battery healthy?
A word that means fill it to the required quantity
Why does the nucleus not repel itself?
Geography at the pixel level
remote mysql login using username / password not working when adding password to command line
The 2019 Stack Overflow Developer Survey Results Are Inmysql replication not workingIf I sudo execute a Bash script file, will all commands inside the Bash script be executed as sudo as well?php-mysql not workingssh port forwarding through pseudo terminalSilent MySQL Server installationHow to change MySQL 'root' password using MySQL v5.7?MySQL root account without password?Attempting to connect to remote server with SFTP but receiving a needless passphrase promptAutomating wp-config.php creationMySQL dump, access denied 1045 with correct username and password
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am running the following command to connect to a remove mysql server (it is part of a bash script that will connect automatically)
mysql -h slave1 -u monitor -pvP!KnK4*
And I receive the following response within the terminal window
-bash: !KnK4: event not found
When I run mysql -h slave1 -u monitor -p without adding the passing in the command line and use the same password when prompted to enter it in this works fine.
What am I doing wrong in this instance?
PS the password above is not the real password (it is much longer just made it smaller for stackexchange purposes)
bash terminal mysql
add a comment |
I am running the following command to connect to a remove mysql server (it is part of a bash script that will connect automatically)
mysql -h slave1 -u monitor -pvP!KnK4*
And I receive the following response within the terminal window
-bash: !KnK4: event not found
When I run mysql -h slave1 -u monitor -p without adding the passing in the command line and use the same password when prompted to enter it in this works fine.
What am I doing wrong in this instance?
PS the password above is not the real password (it is much longer just made it smaller for stackexchange purposes)
bash terminal mysql
apparently bash treats everyting before the ! sign, namely "pvP" in your case, as options. Try to add a space after "-p". And better don't use the "-p" option on a live server, since the password remains in the bash history and can be stolen
– user907860
14 hours ago
tried the space and it still doesn't seem to work :(
– Zabs
14 hours ago
did you try quotes?
– user907860
13 hours ago
characters like ! and * can well be special to bash. So use them in single quotes
– user907860
13 hours ago
add a comment |
I am running the following command to connect to a remove mysql server (it is part of a bash script that will connect automatically)
mysql -h slave1 -u monitor -pvP!KnK4*
And I receive the following response within the terminal window
-bash: !KnK4: event not found
When I run mysql -h slave1 -u monitor -p without adding the passing in the command line and use the same password when prompted to enter it in this works fine.
What am I doing wrong in this instance?
PS the password above is not the real password (it is much longer just made it smaller for stackexchange purposes)
bash terminal mysql
I am running the following command to connect to a remove mysql server (it is part of a bash script that will connect automatically)
mysql -h slave1 -u monitor -pvP!KnK4*
And I receive the following response within the terminal window
-bash: !KnK4: event not found
When I run mysql -h slave1 -u monitor -p without adding the passing in the command line and use the same password when prompted to enter it in this works fine.
What am I doing wrong in this instance?
PS the password above is not the real password (it is much longer just made it smaller for stackexchange purposes)
bash terminal mysql
bash terminal mysql
edited 13 hours ago
Zabs
asked 14 hours ago
ZabsZabs
1275
1275
apparently bash treats everyting before the ! sign, namely "pvP" in your case, as options. Try to add a space after "-p". And better don't use the "-p" option on a live server, since the password remains in the bash history and can be stolen
– user907860
14 hours ago
tried the space and it still doesn't seem to work :(
– Zabs
14 hours ago
did you try quotes?
– user907860
13 hours ago
characters like ! and * can well be special to bash. So use them in single quotes
– user907860
13 hours ago
add a comment |
apparently bash treats everyting before the ! sign, namely "pvP" in your case, as options. Try to add a space after "-p". And better don't use the "-p" option on a live server, since the password remains in the bash history and can be stolen
– user907860
14 hours ago
tried the space and it still doesn't seem to work :(
– Zabs
14 hours ago
did you try quotes?
– user907860
13 hours ago
characters like ! and * can well be special to bash. So use them in single quotes
– user907860
13 hours ago
apparently bash treats everyting before the ! sign, namely "pvP" in your case, as options. Try to add a space after "-p". And better don't use the "-p" option on a live server, since the password remains in the bash history and can be stolen
– user907860
14 hours ago
apparently bash treats everyting before the ! sign, namely "pvP" in your case, as options. Try to add a space after "-p". And better don't use the "-p" option on a live server, since the password remains in the bash history and can be stolen
– user907860
14 hours ago
tried the space and it still doesn't seem to work :(
– Zabs
14 hours ago
tried the space and it still doesn't seem to work :(
– Zabs
14 hours ago
did you try quotes?
– user907860
13 hours ago
did you try quotes?
– user907860
13 hours ago
characters like ! and * can well be special to bash. So use them in single quotes
– user907860
13 hours ago
characters like ! and * can well be special to bash. So use them in single quotes
– user907860
13 hours ago
add a comment |
1 Answer
1
active
oldest
votes
If you are going to use characters that are special to the shell (e. g. !, *) as a portion of a parameter, you must present it in such a manner as to not be interpreted by the shell before it is passed to the command you're invoking.
Rather than:
$ mysql -h slave1 -u monitor -pvP!KnK4*
Instead use:
$ mysql -h slave1 -u monitor -p'vP!KnK4*'
And then, when you have a moment, change your MySQL user's password if this is your actual password because you have put it on the internet for all to see.
(As a further aside, you should be aware that anyone who is able to read your user's shell history file also has access to this password.)
will try that (the pwd itself is different just similar syntax although much longer)
– Zabs
13 hours ago
1
Glad to hear this is not your actual password.
– DopeGhoti
13 hours ago
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%2f511943%2fremote-mysql-login-using-username-password-not-working-when-adding-password-to%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
If you are going to use characters that are special to the shell (e. g. !, *) as a portion of a parameter, you must present it in such a manner as to not be interpreted by the shell before it is passed to the command you're invoking.
Rather than:
$ mysql -h slave1 -u monitor -pvP!KnK4*
Instead use:
$ mysql -h slave1 -u monitor -p'vP!KnK4*'
And then, when you have a moment, change your MySQL user's password if this is your actual password because you have put it on the internet for all to see.
(As a further aside, you should be aware that anyone who is able to read your user's shell history file also has access to this password.)
will try that (the pwd itself is different just similar syntax although much longer)
– Zabs
13 hours ago
1
Glad to hear this is not your actual password.
– DopeGhoti
13 hours ago
add a comment |
If you are going to use characters that are special to the shell (e. g. !, *) as a portion of a parameter, you must present it in such a manner as to not be interpreted by the shell before it is passed to the command you're invoking.
Rather than:
$ mysql -h slave1 -u monitor -pvP!KnK4*
Instead use:
$ mysql -h slave1 -u monitor -p'vP!KnK4*'
And then, when you have a moment, change your MySQL user's password if this is your actual password because you have put it on the internet for all to see.
(As a further aside, you should be aware that anyone who is able to read your user's shell history file also has access to this password.)
will try that (the pwd itself is different just similar syntax although much longer)
– Zabs
13 hours ago
1
Glad to hear this is not your actual password.
– DopeGhoti
13 hours ago
add a comment |
If you are going to use characters that are special to the shell (e. g. !, *) as a portion of a parameter, you must present it in such a manner as to not be interpreted by the shell before it is passed to the command you're invoking.
Rather than:
$ mysql -h slave1 -u monitor -pvP!KnK4*
Instead use:
$ mysql -h slave1 -u monitor -p'vP!KnK4*'
And then, when you have a moment, change your MySQL user's password if this is your actual password because you have put it on the internet for all to see.
(As a further aside, you should be aware that anyone who is able to read your user's shell history file also has access to this password.)
If you are going to use characters that are special to the shell (e. g. !, *) as a portion of a parameter, you must present it in such a manner as to not be interpreted by the shell before it is passed to the command you're invoking.
Rather than:
$ mysql -h slave1 -u monitor -pvP!KnK4*
Instead use:
$ mysql -h slave1 -u monitor -p'vP!KnK4*'
And then, when you have a moment, change your MySQL user's password if this is your actual password because you have put it on the internet for all to see.
(As a further aside, you should be aware that anyone who is able to read your user's shell history file also has access to this password.)
answered 13 hours ago
DopeGhotiDopeGhoti
47k56190
47k56190
will try that (the pwd itself is different just similar syntax although much longer)
– Zabs
13 hours ago
1
Glad to hear this is not your actual password.
– DopeGhoti
13 hours ago
add a comment |
will try that (the pwd itself is different just similar syntax although much longer)
– Zabs
13 hours ago
1
Glad to hear this is not your actual password.
– DopeGhoti
13 hours ago
will try that (the pwd itself is different just similar syntax although much longer)
– Zabs
13 hours ago
will try that (the pwd itself is different just similar syntax although much longer)
– Zabs
13 hours ago
1
1
Glad to hear this is not your actual password.
– DopeGhoti
13 hours ago
Glad to hear this is not your actual password.
– DopeGhoti
13 hours ago
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%2f511943%2fremote-mysql-login-using-username-password-not-working-when-adding-password-to%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
apparently bash treats everyting before the ! sign, namely "pvP" in your case, as options. Try to add a space after "-p". And better don't use the "-p" option on a live server, since the password remains in the bash history and can be stolen
– user907860
14 hours ago
tried the space and it still doesn't seem to work :(
– Zabs
14 hours ago
did you try quotes?
– user907860
13 hours ago
characters like ! and * can well be special to bash. So use them in single quotes
– user907860
13 hours ago