Thursday, 15 March 2012

php - mysql connect error access denied -



php - mysql connect error access denied -

i'm having problem connecting database , i've been playing trying different codings different errors. i've searched same problem others had nil solved problem

i registered hosting business relationship in godaddy , i'm using linux i'm not sure if has problem. when seek using localhost works fine when in website error

access denied user 'root'@'23.229.234.67' (using password: no)

here's code:

<?php session_start(); $db_conx = mysqli_connect("examplesite.com", "root", "", "mydb"); if (mysqli_connect_errno()) { echo mysqli_connect_error(); exit(); } ?>

i appreciate comment , in advance.

you show add together entry mysql database saying need access ip 23.229.234.67.

to log in mysql using localhost.

use database named mysql.

add end enrty ip 23.229.234.67 user table follows

insert user (`host`, `user` , `password`) values("23.229.234.67","root", "enter hash value in localhost enrty related 'mydb'");

restart mysql service follows

sudo service mysql restart

then should work fine , should able log in mysql mysqli_connect("examplesite.com", "root", "", "mydb");

make sure have mapped ip host in /etc/hosts file follows

23.229.234.67 examplesite.com

php linux mysqli godaddy connect

No comments:

Post a Comment