Php – How to find the host and username on thesql

credentialslocalhostMySQLPHP

I need to open my database through PHP. But I need to know my username and the name of my host (e.g. localhost), and I don't know them.

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

How do I find my host and username on mysql?

Best Answer

type this command

select CURRENT_USER();

You will get the username and server