#1045 - Access denied for user 'root'@'localhost' (using password: NO)
This is very common error encountered while using WAMP server , its because you have not set mySql password and you need to set it first!
Solution :
1) Go to C:\wamp\bin\mysql\mysql5.1.36\bin\
2) mysql.exe -u root -p
3) mysql>
4) Type this query :
update mysql.user set password=password('1234') where user='root';
5) flush privileges;
6) That's it! now u set password 1234 to mysql.
7) Now whenever you will establish connection with mysql from php pages you will need to provide this password 1234
Thank You,
Have A Nice Day!
Welcome to My Infotech Blog (Read on Post's on Programming,database, and RedHat and much more) Happy Blogging, Have a pleasent Stay !
Showing posts with label Mysql. Show all posts
Showing posts with label Mysql. Show all posts
Thursday, October 21, 2010
Monday, August 16, 2010
Mysql Basic
- Start mysql from start menu
- It will ask you password just enter whatever you specified while installing mysql.
- you get mysql> prompt
- To view available databases fire up : show databases;
- To select database fire up : use databasename;
- To show created tables in mysql fire up : show tables;
Very small introduction for connecting to mysql database! rest you can execute your own queries there on prompt...
My SQL Frequent commands :
My SQL Frequent commands :
Reset MySQL password
Some days back i just forget this password for Mysql and there is very easy way to reset this password, simply follow below steps : (Windows XP)
- Go to control panel > administrative tasks > services
- Select mysql service from right pane
- right click on it and 'STOP' the service
- There is a way to start the server with special init file which you can create as follows :
UPDATE mysql.user SET Password=PASSWORD('girish') WHERE User='root';
FLUSH PRIVILEGES;
- Copy above 2 lines and paste it in notepad and save this file as : mysqlpwdreset.txt
- Now fire up :
C:\mysql\bin\mysqld-nt --init-file=C:\\mysqlpwdreset.txt
For More Information Click here
Thats it! Now Fire up your mysql and enter this new password !
Thank You,
Subscribe to:
Posts (Atom)