I had the luck to forget the root MySQL password on one of my servers today (a VPS with CentOS 6.2). So I had no choice but to reset the root password. Just in case you get in the same boat with me, here’s what I did.
First off, stop the MySQL server.
service mysqld stop
Then start the mysql daemon skipping the grants table which stores the password.
This will start the mysql daemon but will not exit. You’ll need to connect again to the server on another terminal. This time you can login as root without the password.
mysql --user=root mysql
Then this command will reset the root password.
update user set password=PASSWORD('new-password') where user='root';
Flush privileges and you are done.
Do take note that resetting the root password has its inherent risks. So make sure you understand what you are doing before you execute a command.
Take note that I was running as (linux) root to execute the reset.
Google analytics is an awesome webmaster tool, but sometimes it can be a pain in the ass to manage it specially for the few who are in a hurry. I was cleaning up my analytics account and had to delete a couple of stale profiles, unfortunately the delete button for profiles isn’t easily accessible. So [...]
When you host a good number of virtual sites on your VPS it’s not a good idea to use the default settings of PHP APC because unless you have a large amount of ram to spare, then chances are APC will gobble all of it. And when PHP APC runs out of memory to use, [...]
For a guy like me who has more than a hundred (and growing) different user names and passwords to remember it can be a frustrating experience whenever I forget a user/password pair. Fortunately, I don’t have to do that anymore though after I discovered the DropBox and Efficient Password Manager (EPM) combo. While a lot of [...]
Here’s how I installed nginx + php-fpm + apc + mysql on CentOS 6.2 x64. This will likely work on version 6.3 as well. A big thanks to Remi from famillecollet.com for his stable binaries (repositories) on CentOS and Mell Zamora for creating a kick-ass CentOS guide where I based my installation. Please note that in all [...]
It all started with with curiosity and a free trial. For one, a $5 per month virtual private server with virtually unlimited bandwidth sounds too good to be true. As far as I know this would be the first from DigitalOcean. However, I was taken by surprise not only with the lower cost but specially [...]
I had the good opportunity of ending up on Jim Westgren’s article about using Redis as a front end cache and it didn’t take long for me to try it on one of my virtual boxes. The results were unbelievable, pages that were taking about 0.2 to 1.2 seconds were now loading at 0.0025 second [...]
I just said goodbye to my old windows mobile phone yesterday. Got myself an LG P500 (with a stock Android Froyo) since it came bundled with my mobile line (Globe). I have to say that this mobile OS is definitely for geeks. Since Android Gingerbread was already out, I decided to upgrade my phone’s OS. [...]
I converted one of my websites today with static html pages to WordPress. Problem is I don’t want to lose the URLs on that site since they were already good as is. Solution, install WordPress on a different directory first – www.domain.com/wp/ then after the content has been transferred/copied, route it to www.domain.com. 1. I [...]
I’ve set my laptop to sleep after half an hour but sometimes I need to leave immediately and I want to sleep it right away, however for the nth time I’ve accidentally shutdown my computer instead of putting it to sleep. Solution (which I’ve been putting off for a long time)? Change the default action [...]