Unable to start mysql after deleting all the users and reinstalling all mysql package





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I know the subject been mentioned plenty of times, however I have done extensive research and I am still unable to connect.



Need advice on how to either fix or reinstalling (which I have already done) mysql and I still can not connect to mysql with this message appearing primarily:



ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) (sometimes its YES sometimes is NO)


Briefly:



I have deleted all the users, including root (why not ;) !)
to have a nice start.



Installed Dbeaver and Workbench.



Done most things from around 5-7 sources/advices online.



Finally, loosing faith I have removed and reinstalled.



sudo apt-get (remove/install) mysql-server mysql-client mysql-common mysql-workbench


Things tried:



service mysql restart --skip-grant-tables 


then trying to



mysql -u root 


or



mysql -u root -p


In between I have done



systemctl restart mysql-server


many times



Also after restarting grant tables I have tried:



UPDATE mysql.user SET Password=PASSWORD('mypassword') WHERE User='root';


One advice recommended dangerous solution of adding a file with root and password details to /root/.my.cnf which I have done according to advice. No results.



I then find an advice to add root and password details to



/etc/mysql/my.cnf 


which failed. Well know error appear:



error: 'Access denied for user 'root'@'localhost' (using password: NO)'


Now I keep trying:



sudo mysqladmin -u root password root


and different verision of that



I also keep trying:



sudo mysql -u root -p


ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


This "using password: YES/NO" is confusing for me as I do not know what does it mean. Is there a password or do I need a passoword. I am guessing it describe the fact.



I wonder if editing my.cnf is still the solution as when "sudo updatedb && locate my.cnf" it gives me three locations:



/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/etc/mysql/my.cnf.fallback
/var/lib/dpkg/alternatives/my.cnf


and I only add the user and password in the second one (just guessing :) )



Workbench displays:



"Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Access denied for user 'root'@'localhost' (using password: NO)"


Other commands found online:



mysql -u root mysql


By the way. Does someone could recommend some short tutorial on how to handle the complexity of starting database, how to connect to database, short description of how workbench work in context of my sql, what is the process of starting up with mysql? Dealing with internet? etc?



Thanks a lot for advices.



Kind regards,



eager



other commands tried:



sudo mysql -> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

sudo mysql -u root ->ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)









share|improve this question























  • At this point, I'd purge (not remove) the whole mysql package and start anew.

    – Jos
    2 days ago











  • Done with commands from here: stackoverflow.com/questions/10853004/…

    – eagerpupil
    2 days ago











  • sudo apt-get remove --purge mysql-server mysql-client mysql-common ... I don't see the --purge flag on your question. Is that what you've tried?

    – Rafael Muynarsk
    yesterday











  • Done it with purge, which made difference. Please check the commands on the most upvoted answer in the link above(not questions commands). Seems like pretty good uninstaller.

    – eagerpupil
    yesterday


















0















I know the subject been mentioned plenty of times, however I have done extensive research and I am still unable to connect.



Need advice on how to either fix or reinstalling (which I have already done) mysql and I still can not connect to mysql with this message appearing primarily:



ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) (sometimes its YES sometimes is NO)


Briefly:



I have deleted all the users, including root (why not ;) !)
to have a nice start.



Installed Dbeaver and Workbench.



Done most things from around 5-7 sources/advices online.



Finally, loosing faith I have removed and reinstalled.



sudo apt-get (remove/install) mysql-server mysql-client mysql-common mysql-workbench


Things tried:



service mysql restart --skip-grant-tables 


then trying to



mysql -u root 


or



mysql -u root -p


In between I have done



systemctl restart mysql-server


many times



Also after restarting grant tables I have tried:



UPDATE mysql.user SET Password=PASSWORD('mypassword') WHERE User='root';


One advice recommended dangerous solution of adding a file with root and password details to /root/.my.cnf which I have done according to advice. No results.



I then find an advice to add root and password details to



/etc/mysql/my.cnf 


which failed. Well know error appear:



error: 'Access denied for user 'root'@'localhost' (using password: NO)'


Now I keep trying:



sudo mysqladmin -u root password root


and different verision of that



I also keep trying:



sudo mysql -u root -p


ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


This "using password: YES/NO" is confusing for me as I do not know what does it mean. Is there a password or do I need a passoword. I am guessing it describe the fact.



I wonder if editing my.cnf is still the solution as when "sudo updatedb && locate my.cnf" it gives me three locations:



/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/etc/mysql/my.cnf.fallback
/var/lib/dpkg/alternatives/my.cnf


and I only add the user and password in the second one (just guessing :) )



Workbench displays:



"Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Access denied for user 'root'@'localhost' (using password: NO)"


Other commands found online:



mysql -u root mysql


By the way. Does someone could recommend some short tutorial on how to handle the complexity of starting database, how to connect to database, short description of how workbench work in context of my sql, what is the process of starting up with mysql? Dealing with internet? etc?



Thanks a lot for advices.



Kind regards,



eager



other commands tried:



sudo mysql -> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

sudo mysql -u root ->ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)









share|improve this question























  • At this point, I'd purge (not remove) the whole mysql package and start anew.

    – Jos
    2 days ago











  • Done with commands from here: stackoverflow.com/questions/10853004/…

    – eagerpupil
    2 days ago











  • sudo apt-get remove --purge mysql-server mysql-client mysql-common ... I don't see the --purge flag on your question. Is that what you've tried?

    – Rafael Muynarsk
    yesterday











  • Done it with purge, which made difference. Please check the commands on the most upvoted answer in the link above(not questions commands). Seems like pretty good uninstaller.

    – eagerpupil
    yesterday














0












0








0








I know the subject been mentioned plenty of times, however I have done extensive research and I am still unable to connect.



Need advice on how to either fix or reinstalling (which I have already done) mysql and I still can not connect to mysql with this message appearing primarily:



ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) (sometimes its YES sometimes is NO)


Briefly:



I have deleted all the users, including root (why not ;) !)
to have a nice start.



Installed Dbeaver and Workbench.



Done most things from around 5-7 sources/advices online.



Finally, loosing faith I have removed and reinstalled.



sudo apt-get (remove/install) mysql-server mysql-client mysql-common mysql-workbench


Things tried:



service mysql restart --skip-grant-tables 


then trying to



mysql -u root 


or



mysql -u root -p


In between I have done



systemctl restart mysql-server


many times



Also after restarting grant tables I have tried:



UPDATE mysql.user SET Password=PASSWORD('mypassword') WHERE User='root';


One advice recommended dangerous solution of adding a file with root and password details to /root/.my.cnf which I have done according to advice. No results.



I then find an advice to add root and password details to



/etc/mysql/my.cnf 


which failed. Well know error appear:



error: 'Access denied for user 'root'@'localhost' (using password: NO)'


Now I keep trying:



sudo mysqladmin -u root password root


and different verision of that



I also keep trying:



sudo mysql -u root -p


ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


This "using password: YES/NO" is confusing for me as I do not know what does it mean. Is there a password or do I need a passoword. I am guessing it describe the fact.



I wonder if editing my.cnf is still the solution as when "sudo updatedb && locate my.cnf" it gives me three locations:



/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/etc/mysql/my.cnf.fallback
/var/lib/dpkg/alternatives/my.cnf


and I only add the user and password in the second one (just guessing :) )



Workbench displays:



"Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Access denied for user 'root'@'localhost' (using password: NO)"


Other commands found online:



mysql -u root mysql


By the way. Does someone could recommend some short tutorial on how to handle the complexity of starting database, how to connect to database, short description of how workbench work in context of my sql, what is the process of starting up with mysql? Dealing with internet? etc?



Thanks a lot for advices.



Kind regards,



eager



other commands tried:



sudo mysql -> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

sudo mysql -u root ->ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)









share|improve this question














I know the subject been mentioned plenty of times, however I have done extensive research and I am still unable to connect.



Need advice on how to either fix or reinstalling (which I have already done) mysql and I still can not connect to mysql with this message appearing primarily:



ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) (sometimes its YES sometimes is NO)


Briefly:



I have deleted all the users, including root (why not ;) !)
to have a nice start.



Installed Dbeaver and Workbench.



Done most things from around 5-7 sources/advices online.



Finally, loosing faith I have removed and reinstalled.



sudo apt-get (remove/install) mysql-server mysql-client mysql-common mysql-workbench


Things tried:



service mysql restart --skip-grant-tables 


then trying to



mysql -u root 


or



mysql -u root -p


In between I have done



systemctl restart mysql-server


many times



Also after restarting grant tables I have tried:



UPDATE mysql.user SET Password=PASSWORD('mypassword') WHERE User='root';


One advice recommended dangerous solution of adding a file with root and password details to /root/.my.cnf which I have done according to advice. No results.



I then find an advice to add root and password details to



/etc/mysql/my.cnf 


which failed. Well know error appear:



error: 'Access denied for user 'root'@'localhost' (using password: NO)'


Now I keep trying:



sudo mysqladmin -u root password root


and different verision of that



I also keep trying:



sudo mysql -u root -p


ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


This "using password: YES/NO" is confusing for me as I do not know what does it mean. Is there a password or do I need a passoword. I am guessing it describe the fact.



I wonder if editing my.cnf is still the solution as when "sudo updatedb && locate my.cnf" it gives me three locations:



/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/etc/mysql/my.cnf.fallback
/var/lib/dpkg/alternatives/my.cnf


and I only add the user and password in the second one (just guessing :) )



Workbench displays:



"Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Access denied for user 'root'@'localhost' (using password: NO)"


Other commands found online:



mysql -u root mysql


By the way. Does someone could recommend some short tutorial on how to handle the complexity of starting database, how to connect to database, short description of how workbench work in context of my sql, what is the process of starting up with mysql? Dealing with internet? etc?



Thanks a lot for advices.



Kind regards,



eager



other commands tried:



sudo mysql -> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

sudo mysql -u root ->ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)






mysql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









eagerpupileagerpupil

11




11













  • At this point, I'd purge (not remove) the whole mysql package and start anew.

    – Jos
    2 days ago











  • Done with commands from here: stackoverflow.com/questions/10853004/…

    – eagerpupil
    2 days ago











  • sudo apt-get remove --purge mysql-server mysql-client mysql-common ... I don't see the --purge flag on your question. Is that what you've tried?

    – Rafael Muynarsk
    yesterday











  • Done it with purge, which made difference. Please check the commands on the most upvoted answer in the link above(not questions commands). Seems like pretty good uninstaller.

    – eagerpupil
    yesterday



















  • At this point, I'd purge (not remove) the whole mysql package and start anew.

    – Jos
    2 days ago











  • Done with commands from here: stackoverflow.com/questions/10853004/…

    – eagerpupil
    2 days ago











  • sudo apt-get remove --purge mysql-server mysql-client mysql-common ... I don't see the --purge flag on your question. Is that what you've tried?

    – Rafael Muynarsk
    yesterday











  • Done it with purge, which made difference. Please check the commands on the most upvoted answer in the link above(not questions commands). Seems like pretty good uninstaller.

    – eagerpupil
    yesterday

















At this point, I'd purge (not remove) the whole mysql package and start anew.

– Jos
2 days ago





At this point, I'd purge (not remove) the whole mysql package and start anew.

– Jos
2 days ago













Done with commands from here: stackoverflow.com/questions/10853004/…

– eagerpupil
2 days ago





Done with commands from here: stackoverflow.com/questions/10853004/…

– eagerpupil
2 days ago













sudo apt-get remove --purge mysql-server mysql-client mysql-common ... I don't see the --purge flag on your question. Is that what you've tried?

– Rafael Muynarsk
yesterday





sudo apt-get remove --purge mysql-server mysql-client mysql-common ... I don't see the --purge flag on your question. Is that what you've tried?

– Rafael Muynarsk
yesterday













Done it with purge, which made difference. Please check the commands on the most upvoted answer in the link above(not questions commands). Seems like pretty good uninstaller.

– eagerpupil
yesterday





Done it with purge, which made difference. Please check the commands on the most upvoted answer in the link above(not questions commands). Seems like pretty good uninstaller.

– eagerpupil
yesterday










0






active

oldest

votes












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


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1132519%2funable-to-start-mysql-after-deleting-all-the-users-and-reinstalling-all-mysql-pa%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1132519%2funable-to-start-mysql-after-deleting-all-the-users-and-reinstalling-all-mysql-pa%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

香粉寮

GameSpot