mysqli error

Status
Not open for further replies.

jnealyeg

New Member
Messages
3
Reaction score
0
Points
1
Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'root'@'localhost' (using password: NO)

getting this error when trying to connect to database.. I found a thread similar to this via the search, but the link within said thread is now dead, but the solution seemed to be not to use localhost, and the IP in my "database hosts" 198.91.81.8 doesnt want to work either. I've got the correct user/pass as well.

Been googling, cant come up with correct answer from stack overflow or any other resources.

Please help,

Thanks!
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
Make sure you have created a new MySQL user via cPanel that is hooked up with the database you would like to use.
Also, ensure that the host name used is 'localhost' and nothing else.
 

jnealyeg

New Member
Messages
3
Reaction score
0
Points
1
$db_name = 'jnealyeg_test';
$db_user = 'jnealyeg_user';
$db_pass = 'redacted';
$db_host = 'localhost';
$db_port = '3306';

From Cpanel:
Database Name Disk Usage MySQL Users
jnealyeg_test 0.00 MB jnealyeg_user

So all of my information looks correct
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
The warning you had posted said that you were using 'root' as the user. What does it show now?
 

jnealyeg

New Member
Messages
3
Reaction score
0
Points
1
Still shows root, whether I use variables or if I put the info directly into mysqli('host','user','pass','name')
 
Status
Not open for further replies.
Top