Skip to main content

Clear your MySQL password

·173 words·1 min· ·
MySQL Development Password
Ariejan de Vroom
Author
Ariejan de Vroom
Jack of all Trades, Professional Software Craftsman

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.

Related

MySQL: (Re)set the auto-increment value of a table
·134 words·1 min
General Blog Databases MySQL Development
Once and for all: Rails migrations integer :limit option
·99 words·1 min
MySQL Ruby on Rails Rails Sql Migrations Integer Limit
Available for iPhone Development
·42 words·1 min
General Apple IPod Development Mac Iphone Sdk Hire Available