7

Clear your MySQL password

 3 years ago
source link: https://www.devroom.io/2010/10/26/clear-your-mysql-password/?utm_campaign=Feed%3A+ariejan+%28ariejan%7Cdevroom.io%29
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Clear your MySQL password

Posted: 2010-10-26 - Last updated: 2019-06-05

Tagged mysql development password

Most people need their MySQL database protected with at least a decent password. I agree, but in development this often causes conflicts - and I prefer to work with my MySQL datbase without all the password-hassle.

On Ubuntu I recently installed MySQL and set a password. Here’s how to remove that password so you can skip all the password stuff during development. ~ First, connect to MySQL and check what permissions are currently set:

$ mysql -u root -p
use mysql;
select Host, User, Password from user;

You’ll probably see three entries for the root user: localhost, 127.0.0.1 and your hostname like hostname. To clear the password for the root user issue the following query:

update user set password = '' where user = 'root';

Optionally, you may only want to reset the password for localhost:

update user set password = '' where user = 'root' and host = 'localhost';

Keep in mind that using no MySQL password is insecure. Always protected your MySQL database with at least a strong password in production.

My site is free of ads and trackers. I record privacy-respecting usage statistics with Fathom.

Was this post helpful to you? Why not ☕ Buy me a coffee

Copyright © 1999-2020 Ariejan de Vroom <[email protected]>

Live now; make now always the most precious time. Now will never come again.
    – Jean-Luc Picard


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK