$mysqli = new mysqli('localhost', 'root', '789456','ai');
I write this and turn on the xampp
mysql have aipharm name , it’s host is local(127.0.0.1),username is just root, password is same too and port is 3310.
At the left side, mysql icon with the name ai is shown but i can’t connect with that mysql database… am i use workbench? or did i wrote wrong code?
If possible i want just use only vscode
2
Answers
You are passing wrong parameter, as you said password is also root but you configured something else.
This will print
make sure your mysql username & password is right. Usually root account has no password so if you didn’t add a password to the root account leave the password section empty.
if you can’t find your username or password[1]
[1]: https://www.youtube.com/watch?v=1Sl5aQg8E4I
Or you can create a new user[2]
[2]: https://www.youtube.com/watch?v=zS4g31spQ00
use this I think you easily understand & use it 🙂