Reputation: 29
Hi I developed a php website with mysql. It worked perfectly on localhost
. I hosted my site and change database config file,
<?php
define("dbhost", "128.199.145.183");
define("dbuser", "root");
define("dbpass", "xxxxxxx");
define("dbname", "database");
$dbc = new mysqli(dbhost,dbuser,dbpass,dbname);
?>
But it not worked. My site is working fine and when i tried to login i got an HTTP 500 error. How can i solve this?
Upvotes: 0
Views: 83
Reputation: 12391
root
database user doesn't have by default access to access database remotely.
you can verify this by looking at the mysql.user table
use mysql;
select * from user;
check if root has the ip access from %
I would recommend, create another user with limited rights on host as %
(can access database remotely)
You can create user like this:
use mysql;
create user testing@'%' indentified by 'testing_password';
grant all on *.* to testing; // you can specify databases or specific permissions
flush privileges;
Upvotes: 1