I have installed wamp server(apache, mysql, php for windows). It installs phpMyAdmin. When I try to open phpMyAdmin, it gives an error
MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server."
I was never asked to setup username or password, then why am I getting such an error ?
Secondly, when I have to use a database with php, it asks for database user and database password. What is this user and password ? When I create a database, I dont provide a username or password for this database. So how can I get this ?
I already had MySql installed on my computer. So how does this affect new installation of MySql with wamp ? How do I know which MySql am I using ? New one or already existing one ?
nirjari patel wrote:I was never asked to setup username or password, then why am I getting such an error ?
The wamp installer probably ste a default password. You should look at the docs for your wamp server to find out what it set. (I always install the pieces separately, and the MySQL installer always asks for the root password to set.)
Secondly, when I have to use a database with php, it asks for database user and database password.
You alsways need to provide this information so that the database knows you have access. By the way, when MySQL gets installed, what you really get is a database server (yes, there are 2 databases created for that server, but you shouldn't use those). Before you use the database, you have to create one. The steps are usually:
1) Create the database
2) Create a user and assign rights to that database
This page should help, scroll down to the "Create a database using MySQL Commands" section:
I already had MySql installed on my computer. So how does this affect new installation of MySql with wamp ?
That all depends on how the wamp installer works. It could have used the existing MySQL, or it could have installed another one and set it to use a different port. In the latter case you will have both MySQLs running. Check Task Manager, and also look at the list of services in control panel.
By the way, it would help if you gave us the link to the wamp server that you downloaded and installed. There are several, and not knowing which one you used makes it difficult to help you.