How do I find my local host and username on mysql?


I need to open my database through PHP but I need to know my username and the name of my localhost, and i don't know them.

When i used mysql and did my database it just asked me directly for a password.

2/25/2010 4:05:58 PM

Accepted Answer

The default username is root. You can reset the root password if you do not know it: You should not, however, use the root account from PHP, set up a limited permission user to do that:

If MySql is running on the same computer as your webserver, you can just use "localhost" as the host

2/25/2010 4:12:30 PM

type this command

select CURRENT_USER();

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow