简体   繁体   中英

Access denied for user 'web'@'localhost' remote mysql

I've hosted my site and database on one VPS, but now I'm trying to migrate the website to a shared hosting, so on the VPS will remain only the database. I granted full privileges to all mysql users and also my config.php is configured to connect with the VPS's IP address but for some reason it gives me this error:

Access denied for user 'root'@'localhost' (using password: YES)

The strange thing here is that in the config.php, ["username"] is not 'root' and the ["hostname"] is not 'localhost'.

Here is the config.php

$db["hostname"] = "VPS's IP address";
$db["username"] = "treewee";
$db["password"] = "my MYSQL password";
$db["database"] = "web";
$db["port"] = 3306;

Also the bind-address is dissabled with # - # bind-address="localhost" . And yes, as I said all mysql users are granted with full privileges (including root & treewee).

In other words, I will not use MySQL provided to me by the shared hosting. However I added the VPS's IP in cPanel > Remote MySQL, but nothing... Still the same error.. Any ideas?

Sorry for my English

$db["username"] = "treewee" - that's the user that i use;

there is an unwanted 's in "that's", not sure if that is intentional or it's in the actual code.

What is actually trying to access the database? maybe you are using the wrong credentials, using root/localhost instead of "treewee"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM