Showing posts with label Database. Show all posts
Showing posts with label Database. Show all posts

Tuesday, January 19, 2010

PHP 5.3 and MySQL timeouts

On my dev machine, WinXP SP3, I had PHP 5.2 configured with IIS 5.1 and MySQL 5. Recently upgraded to PHP 5.3  and whooops.. most of my applications stop working.. :?  first the ISAPI was discontinued so I had to go the FastCGI way but for some reason I just could not make it work. The browser will just offer me to download/ save the file. As I was in a hurry I thought $#@*& IIS, lets try Apache. Installed and configured Apache with PHP and the phpinfo page works fine but pages with MySQL connection will still not load... after wasting sometime trying to figure out what was wrong, went to the doorstep of all knowing Google.. and found this

Tuesday, January 13, 2009

Reset MySql root password


Well, it had been quite sometime since I used MySql and then for some demo I had to. But, the problem was that I had forgotten the password and googling for help told me that I am not the only stupid in this universe Embarassed. Well here is the solution to the problem:





  1. Stop your MySql service.




  2. Open and command window.




  3. cd to the MySql bin directory (if the MySql bin is not added to your path).




  4. Now run this command
    mysqld-nt.exe --skip-grant-tables &




  5. Now open another command window and if required again cd to the MySql bin window and run this command
    mysql -u root mysql




  6. In MySQL command line prompt run the following commands:
    UPDATE user SET password=PASSWORD("password1234") WHERE user="root";
    FLUSH PRIVILEGES;




  7. Yippe... the root password is reset to "password1234" and MySQL will now
    know the privileges and you'll be able to login with your new password.





 Of course this set of instruction is for Windows and MySQL 5. For Linux, I guess (am not sure, so please look around in the mysql bin directory for correct file name), the command in step 4 will change to "mysqld_safe --skip-grant-tables &" (based of googled results). Rest I believe should be same. In case someone I missed something or you have instruction for other OS/ mysql versions, let me know, will be happy to update it.