setting a mysql root password
I just installed mysql-server on Ubuntu 18.0.4.2 LTS and I can now connect to the server just fine when I do mysql
but I can't connect when I do mysql -h127.0.0.1 -uroot -p
.
When I logged in just now with mysql
I did this:
SET PASSWORD = 'mypassword';
But that got me back this warning:
SET PASSWORD has no significance for user 'root'@'localhost' as authentication plugin does not support it.
So how do I set the password for the root user so that I might be able to login with mysql -h127.0.0.1 -uroot -p
(which I assume is more analogous to what MySQL Workbench would be doing)?
linux ubuntu mysql
add a comment |
I just installed mysql-server on Ubuntu 18.0.4.2 LTS and I can now connect to the server just fine when I do mysql
but I can't connect when I do mysql -h127.0.0.1 -uroot -p
.
When I logged in just now with mysql
I did this:
SET PASSWORD = 'mypassword';
But that got me back this warning:
SET PASSWORD has no significance for user 'root'@'localhost' as authentication plugin does not support it.
So how do I set the password for the root user so that I might be able to login with mysql -h127.0.0.1 -uroot -p
(which I assume is more analogous to what MySQL Workbench would be doing)?
linux ubuntu mysql
add a comment |
I just installed mysql-server on Ubuntu 18.0.4.2 LTS and I can now connect to the server just fine when I do mysql
but I can't connect when I do mysql -h127.0.0.1 -uroot -p
.
When I logged in just now with mysql
I did this:
SET PASSWORD = 'mypassword';
But that got me back this warning:
SET PASSWORD has no significance for user 'root'@'localhost' as authentication plugin does not support it.
So how do I set the password for the root user so that I might be able to login with mysql -h127.0.0.1 -uroot -p
(which I assume is more analogous to what MySQL Workbench would be doing)?
linux ubuntu mysql
I just installed mysql-server on Ubuntu 18.0.4.2 LTS and I can now connect to the server just fine when I do mysql
but I can't connect when I do mysql -h127.0.0.1 -uroot -p
.
When I logged in just now with mysql
I did this:
SET PASSWORD = 'mypassword';
But that got me back this warning:
SET PASSWORD has no significance for user 'root'@'localhost' as authentication plugin does not support it.
So how do I set the password for the root user so that I might be able to login with mysql -h127.0.0.1 -uroot -p
(which I assume is more analogous to what MySQL Workbench would be doing)?
linux ubuntu mysql
linux ubuntu mysql
asked Feb 18 at 1:46
neubertneubert
1,833174688
1,833174688
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The issue is that MySQL
now trusts the username the client is being run as IF you are connecting via a socket. You need to change to native password auth, and then set a password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fsuperuser.com%2fquestions%2f1406864%2fsetting-a-mysql-root-password%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
The issue is that MySQL
now trusts the username the client is being run as IF you are connecting via a socket. You need to change to native password auth, and then set a password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';
add a comment |
The issue is that MySQL
now trusts the username the client is being run as IF you are connecting via a socket. You need to change to native password auth, and then set a password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';
add a comment |
The issue is that MySQL
now trusts the username the client is being run as IF you are connecting via a socket. You need to change to native password auth, and then set a password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';
The issue is that MySQL
now trusts the username the client is being run as IF you are connecting via a socket. You need to change to native password auth, and then set a password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';
answered Feb 18 at 2:19
ivanivanivanivan
1,27427
1,27427
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1406864%2fsetting-a-mysql-root-password%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