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;
}







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)










share|improve this question

























  • 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


















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)










share|improve this question

























  • 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














0












0








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)










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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










1 Answer
1






active

oldest

votes


















2














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.)






share|improve this answer
























  • 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












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
});


}
});














draft saved

draft discarded


















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









2














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.)






share|improve this answer
























  • 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
















2














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.)






share|improve this answer
























  • 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














2












2








2







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.)






share|improve this answer













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.)







share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...