Reset MySQL Root Password
Very often, once we didn’t log on to MySQL database for some time, I guess most of us will forgot the root password. Can we reset the root password? Obviously… Nothing is Impossible
Follow the steps below to reset MySQL’s Root Password;
- Stop MySQL Service
- Start MySQL Service in Safe Mode: /usr/local/bin/mysqld_safe –skip-grant-tables&
- Connect to MySQL /usr/local/bin/mysql
- mysql> use mysql;
- mysql> UPDATE user set password=password(‘newpassword’) where user=’root’ and host=’localhost’;
- mysql> flush privileges;
- mysql> quit;
- Stop MySQL Service Again
- Start MySQL Service in normal mode
Log in to MySQL with your newly created password.
Related posts:
- Create Root Privilege User on MySQL By default, MySQL root privileges user is “root”, I always...
- Forget / forgot / cannot remember root password On a FreeBSD server 1. reboot server 2. choose to...
- Change or Set User Password in FreeBSD If you notice, during FreeBSD installation, it doesn’t have a...
- MySQL Cannot Connect with PHP in OSX I think some of you might have problem connecting to...
- MySQL Quick Installation on FreeBSD Quick installation of MySQL Database on FreeBSD Server. Make sure...
- Install MySQL5 on Mac OSX With Darwin Port Before installing MySQL5, please be sure you have Darwin Port...
- bash – dealing with backtics ” ` ” in mysql statement problem : using backticks in bash for mysql statements. e.g....
- Install MySQL5 Server on Apple Mac Leopard with MacPorts Previously I wrote a post on “installing postgresql 8.2 on...
- How to Change MySQL Data Directory in Linux Centos By default Linux CentOS or other Linux Distro installation, MySQL...
- How to Remove MySQL Binary Log By default, MySQL 5.0 and above enables MySQL Binary Log....