Problem in accessing to Mysql
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have installed and reinstalled more times Mysql, but the program deny me always the access saying:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Event if I use the real password, there's no way to get into Mysql. Any suggestion? I'm thinking there's a problem with Grants, by I have no method see them, because they are in Mysql.
permissions mysql
New contributor
add a comment |
I have installed and reinstalled more times Mysql, but the program deny me always the access saying:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Event if I use the real password, there's no way to get into Mysql. Any suggestion? I'm thinking there's a problem with Grants, by I have no method see them, because they are in Mysql.
permissions mysql
New contributor
Did you tried to access without password? Typing onlymysql
oumysql database_name
? This is the new behaviour on newer versions (at least for MariaDB).
– JucaPirama
6 hours ago
How did you install mySQL?
– FloT
5 hours ago
I have installed mysql writing sudo apt-get install mysql-server, and then: sudo mysql_secure_installation.
– GenginsKant
5 hours ago
add a comment |
I have installed and reinstalled more times Mysql, but the program deny me always the access saying:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Event if I use the real password, there's no way to get into Mysql. Any suggestion? I'm thinking there's a problem with Grants, by I have no method see them, because they are in Mysql.
permissions mysql
New contributor
I have installed and reinstalled more times Mysql, but the program deny me always the access saying:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Event if I use the real password, there's no way to get into Mysql. Any suggestion? I'm thinking there's a problem with Grants, by I have no method see them, because they are in Mysql.
permissions mysql
permissions mysql
New contributor
New contributor
New contributor
asked 6 hours ago
GenginsKantGenginsKant
61
61
New contributor
New contributor
Did you tried to access without password? Typing onlymysql
oumysql database_name
? This is the new behaviour on newer versions (at least for MariaDB).
– JucaPirama
6 hours ago
How did you install mySQL?
– FloT
5 hours ago
I have installed mysql writing sudo apt-get install mysql-server, and then: sudo mysql_secure_installation.
– GenginsKant
5 hours ago
add a comment |
Did you tried to access without password? Typing onlymysql
oumysql database_name
? This is the new behaviour on newer versions (at least for MariaDB).
– JucaPirama
6 hours ago
How did you install mySQL?
– FloT
5 hours ago
I have installed mysql writing sudo apt-get install mysql-server, and then: sudo mysql_secure_installation.
– GenginsKant
5 hours ago
Did you tried to access without password? Typing only
mysql
ou mysql database_name
? This is the new behaviour on newer versions (at least for MariaDB).– JucaPirama
6 hours ago
Did you tried to access without password? Typing only
mysql
ou mysql database_name
? This is the new behaviour on newer versions (at least for MariaDB).– JucaPirama
6 hours ago
How did you install mySQL?
– FloT
5 hours ago
How did you install mySQL?
– FloT
5 hours ago
I have installed mysql writing sudo apt-get install mysql-server, and then: sudo mysql_secure_installation.
– GenginsKant
5 hours ago
I have installed mysql writing sudo apt-get install mysql-server, and then: sudo mysql_secure_installation.
– GenginsKant
5 hours ago
add a comment |
2 Answers
2
active
oldest
votes
If you have installed mySQL from Ubuntu repository, the authentication of root user is not possible as usual with mysql -u root -p
.
Instead, you have to type sudo mysql
and the terminal will prompt you with your sudo password.
That should solve your problem and allow you to connect mySQL.
I had the same issue recently and I preferred getting back usual mysql -u root -p
method (also easier to configure some tools e.g. mySQL Workbench, DBeaver...). Here are the steps I followed to get this done:
Connect to mySQL
sudo mysql
Create an admin account
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
You can stop here and use the admin user instead of root. They basically have the same access rights.
If you prefer to come back to root user, you can follow the steps below:
Quit root connection and reconnect with new admin account:
quit; /* mySQL will tell you "Bye" */
mysql -u admin -p
Remove root user
drop user root@localhost;
Re-create root user with usual authentication method
CREATE USER 'root'@'localhost' IDENTIFIED BY 'the_password_you_wish_here';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Then disconnect, re-connect with root and delete the admin account
quit; /* mySQL will tell you "Bye" */
mysql -u root -p
drop user admin@localhost;
Now you'll be able to connect with mysql -u root -p
I have tried the 'sudo mysql' but the answer is almost the same: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
– GenginsKant
5 hours ago
@GenginsKant You can refer to this answer on SO
– Kulfy
5 hours ago
add a comment |
Try this step by step first remove mysql from your machine then just install it by
sudo apt-get install mysql-server
you'll have ask to set a password.
sudo apt-get remove --purge mysql && sudo apt-get purge mysql && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get remove dbconfig-mysql && sudo apt-get dist-upgrade && sudo apt-get install mysql-server
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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
});
}
});
GenginsKant is a new contributor. Be nice, and check out our Code of Conduct.
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%2faskubuntu.com%2fquestions%2f1131286%2fproblem-in-accessing-to-mysql%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you have installed mySQL from Ubuntu repository, the authentication of root user is not possible as usual with mysql -u root -p
.
Instead, you have to type sudo mysql
and the terminal will prompt you with your sudo password.
That should solve your problem and allow you to connect mySQL.
I had the same issue recently and I preferred getting back usual mysql -u root -p
method (also easier to configure some tools e.g. mySQL Workbench, DBeaver...). Here are the steps I followed to get this done:
Connect to mySQL
sudo mysql
Create an admin account
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
You can stop here and use the admin user instead of root. They basically have the same access rights.
If you prefer to come back to root user, you can follow the steps below:
Quit root connection and reconnect with new admin account:
quit; /* mySQL will tell you "Bye" */
mysql -u admin -p
Remove root user
drop user root@localhost;
Re-create root user with usual authentication method
CREATE USER 'root'@'localhost' IDENTIFIED BY 'the_password_you_wish_here';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Then disconnect, re-connect with root and delete the admin account
quit; /* mySQL will tell you "Bye" */
mysql -u root -p
drop user admin@localhost;
Now you'll be able to connect with mysql -u root -p
I have tried the 'sudo mysql' but the answer is almost the same: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
– GenginsKant
5 hours ago
@GenginsKant You can refer to this answer on SO
– Kulfy
5 hours ago
add a comment |
If you have installed mySQL from Ubuntu repository, the authentication of root user is not possible as usual with mysql -u root -p
.
Instead, you have to type sudo mysql
and the terminal will prompt you with your sudo password.
That should solve your problem and allow you to connect mySQL.
I had the same issue recently and I preferred getting back usual mysql -u root -p
method (also easier to configure some tools e.g. mySQL Workbench, DBeaver...). Here are the steps I followed to get this done:
Connect to mySQL
sudo mysql
Create an admin account
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
You can stop here and use the admin user instead of root. They basically have the same access rights.
If you prefer to come back to root user, you can follow the steps below:
Quit root connection and reconnect with new admin account:
quit; /* mySQL will tell you "Bye" */
mysql -u admin -p
Remove root user
drop user root@localhost;
Re-create root user with usual authentication method
CREATE USER 'root'@'localhost' IDENTIFIED BY 'the_password_you_wish_here';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Then disconnect, re-connect with root and delete the admin account
quit; /* mySQL will tell you "Bye" */
mysql -u root -p
drop user admin@localhost;
Now you'll be able to connect with mysql -u root -p
I have tried the 'sudo mysql' but the answer is almost the same: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
– GenginsKant
5 hours ago
@GenginsKant You can refer to this answer on SO
– Kulfy
5 hours ago
add a comment |
If you have installed mySQL from Ubuntu repository, the authentication of root user is not possible as usual with mysql -u root -p
.
Instead, you have to type sudo mysql
and the terminal will prompt you with your sudo password.
That should solve your problem and allow you to connect mySQL.
I had the same issue recently and I preferred getting back usual mysql -u root -p
method (also easier to configure some tools e.g. mySQL Workbench, DBeaver...). Here are the steps I followed to get this done:
Connect to mySQL
sudo mysql
Create an admin account
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
You can stop here and use the admin user instead of root. They basically have the same access rights.
If you prefer to come back to root user, you can follow the steps below:
Quit root connection and reconnect with new admin account:
quit; /* mySQL will tell you "Bye" */
mysql -u admin -p
Remove root user
drop user root@localhost;
Re-create root user with usual authentication method
CREATE USER 'root'@'localhost' IDENTIFIED BY 'the_password_you_wish_here';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Then disconnect, re-connect with root and delete the admin account
quit; /* mySQL will tell you "Bye" */
mysql -u root -p
drop user admin@localhost;
Now you'll be able to connect with mysql -u root -p
If you have installed mySQL from Ubuntu repository, the authentication of root user is not possible as usual with mysql -u root -p
.
Instead, you have to type sudo mysql
and the terminal will prompt you with your sudo password.
That should solve your problem and allow you to connect mySQL.
I had the same issue recently and I preferred getting back usual mysql -u root -p
method (also easier to configure some tools e.g. mySQL Workbench, DBeaver...). Here are the steps I followed to get this done:
Connect to mySQL
sudo mysql
Create an admin account
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
You can stop here and use the admin user instead of root. They basically have the same access rights.
If you prefer to come back to root user, you can follow the steps below:
Quit root connection and reconnect with new admin account:
quit; /* mySQL will tell you "Bye" */
mysql -u admin -p
Remove root user
drop user root@localhost;
Re-create root user with usual authentication method
CREATE USER 'root'@'localhost' IDENTIFIED BY 'the_password_you_wish_here';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Then disconnect, re-connect with root and delete the admin account
quit; /* mySQL will tell you "Bye" */
mysql -u root -p
drop user admin@localhost;
Now you'll be able to connect with mysql -u root -p
answered 5 hours ago
FloTFloT
688117
688117
I have tried the 'sudo mysql' but the answer is almost the same: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
– GenginsKant
5 hours ago
@GenginsKant You can refer to this answer on SO
– Kulfy
5 hours ago
add a comment |
I have tried the 'sudo mysql' but the answer is almost the same: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
– GenginsKant
5 hours ago
@GenginsKant You can refer to this answer on SO
– Kulfy
5 hours ago
I have tried the 'sudo mysql' but the answer is almost the same: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
– GenginsKant
5 hours ago
I have tried the 'sudo mysql' but the answer is almost the same: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
– GenginsKant
5 hours ago
@GenginsKant You can refer to this answer on SO
– Kulfy
5 hours ago
@GenginsKant You can refer to this answer on SO
– Kulfy
5 hours ago
add a comment |
Try this step by step first remove mysql from your machine then just install it by
sudo apt-get install mysql-server
you'll have ask to set a password.
sudo apt-get remove --purge mysql && sudo apt-get purge mysql && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get remove dbconfig-mysql && sudo apt-get dist-upgrade && sudo apt-get install mysql-server
New contributor
add a comment |
Try this step by step first remove mysql from your machine then just install it by
sudo apt-get install mysql-server
you'll have ask to set a password.
sudo apt-get remove --purge mysql && sudo apt-get purge mysql && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get remove dbconfig-mysql && sudo apt-get dist-upgrade && sudo apt-get install mysql-server
New contributor
add a comment |
Try this step by step first remove mysql from your machine then just install it by
sudo apt-get install mysql-server
you'll have ask to set a password.
sudo apt-get remove --purge mysql && sudo apt-get purge mysql && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get remove dbconfig-mysql && sudo apt-get dist-upgrade && sudo apt-get install mysql-server
New contributor
Try this step by step first remove mysql from your machine then just install it by
sudo apt-get install mysql-server
you'll have ask to set a password.
sudo apt-get remove --purge mysql && sudo apt-get purge mysql && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get remove dbconfig-mysql && sudo apt-get dist-upgrade && sudo apt-get install mysql-server
New contributor
New contributor
answered 1 hour ago
Mishuk AdhikariMishuk Adhikari
211
211
New contributor
New contributor
add a comment |
add a comment |
GenginsKant is a new contributor. Be nice, and check out our Code of Conduct.
GenginsKant is a new contributor. Be nice, and check out our Code of Conduct.
GenginsKant is a new contributor. Be nice, and check out our Code of Conduct.
GenginsKant is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1131286%2fproblem-in-accessing-to-mysql%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
Did you tried to access without password? Typing only
mysql
oumysql database_name
? This is the new behaviour on newer versions (at least for MariaDB).– JucaPirama
6 hours ago
How did you install mySQL?
– FloT
5 hours ago
I have installed mysql writing sudo apt-get install mysql-server, and then: sudo mysql_secure_installation.
– GenginsKant
5 hours ago