Mysql PDO Connection to external server - mysql

I'm trying to connect a index.php to a Mysql server external.
I'm using:
$g_con = new PDO('mysql: host=mysql.domain.com;dbname=dbname;charset=utf8', 'dbuser', 'dbpw');
But I get this error:
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'dbname'#'app3.data-center.com' (using password: YES)
I think the problem is that i need to connect to mysql.domain.com (this is my hostname and phpmyadmin login for my external DB) and website show access denied for dbname # app3.data-center.com and 'app3.data-center.com' is the web site hosting sever. Maybe my free hosting don't let me to connect to external db's or what?

Related

(1045, "Access denied for user)

I am trying to connect my Django app on Heroku to an external MySQL database server of another domain. I have already set up the config variable but the Heroku app doesn't seem to be using them.
I get the error below. It seems the Heroku app is using an amazonaws host and not the one I have specified on the DATABASE_URL. Please help
(1045, "Access denied for user 'dekacoke_dekate'#'ec2-3-85-219-69.compute-1.amazonaws.com' (using password: YES)")

MySQL Error: "Access Denied for user 'root'#'localhost' (using password: YES)" upon Windows 10 PC Restart

I installed MySQL 5.5 and provided a password for user 'root'. I can access it using MySQL Workbench. The OS that I am using is Windows 10 Home. Upon restart I am receiving an error:
Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Access defined for user 'root'#'localhost' (using password: YES)
and have some errors in my Web Applications such as Wordpress:
Error Establishing a Database Connection.
Is there a way to access the database and prevent this from happening again. Thank you in advance!

Monitoring : Centreon - How to connect centreon user to database?

I'm running Centreon Entreprise Server (CES) 3.3 and added NagVis (1.8.x). They are on a virtual machine (Virtualbox).
When I suceeded in giving the rights to NagVis to reach my Centreon data, Centreon started displaying : "Database error: Could not connect to database", though the centreon user has all privileges on "centreon" and "centreon_storage".
Here's my central-broker-master.log :
[1467987167] error: storage: rebuilder: could not connect to Centreon Storage database: could not open database: Access denied for user 'centreon'#'localhost' (using password: YES) QMYSQL: Unable to connect
[1467988484] error: TCP: error while sending data to peer 'localhost:5670': The remote host closed the connection
[1467988492] config: module applier: loading directory '/usr/share/centreon/lib/centreon-broker'
[1467988492] config: correlation: invalid correlation configuration, correlation engine is NOT loaded
[1467988492] config: applier: 14 modules loaded
[1467988492] error: could not open database: Access denied for user 'centreon'#'localhost' (using password: YES) QMYSQL: Unable to connect
[1467988492] error: TCP: could not connect to localhost:5670: Connection refused
[1467988492] error: could not open database: Access denied for user 'centreon'#'localhost' (using password: YES) QMYSQL: Unable to connect
(the last error is written hundreds of times ...)
And I couldn't find other errors in different logs. (Or wasn't able to find the right logs ...)
The 'centreon' user has the rights on the databases with the IP address of my server as well as with my coputer's address. (This could have been a matter of rights from a distant location)
I don't know any other way to grant my 'centreon' user with extra rights on the database -- Is it even a valid idea to grant my user with all privileges ?
Thanks
EDIT : I tried to solve the problem by using this post : MySQL ERROR 1045 (28000): Access denied for user 'bill'#'localhost' (using password: YES) (I actually had a ''#'localhost' user), but my access to Centreon web is still denied.

How to connect mobile app using node js to a remote mysql database on Godaddy cPanel?

<-- ErrorPacket { fieldCount: 255, errno: 1045, sqlStateMarker:
'#', sqlState: '28000', message: 'Access denied for user
\'eazy_db\'#\'122.179.102.170\' (using password: YES)' }
Problem with MySQLError: ER_ACCESS_DENIED_ERROR: Access denied for
user 'eazy_db'#'122.179.102.170' (using password: YES)
Getting this error when node server is started. 122.179.102.170 is the router ip address instead of my server ip address.
If you can SSH into your server that is hosting your DB, type in the following Linux command to get your server's IP Address: ifconfig
The response from that command will look like this:
Notice the eth0 block. I highlighted it in a blue box.
That is the I.P. address of your MySQL server.
If you cannot SSH into the server that is hosting your MySQL database, I recommend following these steps and obtaining the Database Host name from the GoDaddy Console: Setting up an Access Database for Your Hosting Account

Database Connection Failed - Error

I need help with sorting out this error. We purchased a website through sites and stores and just states "Upload your website files provided". I have done this directly into our CPanel and this is the error i have received:
Database Connection Failed
Error: Access denied for user 'healthinsurancea'#'localhost' (using password: YES) (1045)
Function Performed: CONNECT
Host/DB: localhost/healthinsurancea_db
Database Type: mysqli
Fatal error: Attempt to connect to database healthinsurancea_db on healthinsurancea#localhost failed in /home/healthin/public_html/lib/adodb.functions.php on line 61
Database Connection Failed
Error: Access denied for user 'healthinsurancea'#'localhost' (using password: YES) (1045)
Function Performed: CONNECT
Host/DB: localhost/healthinsurancea_db
Database Type: mysqli
Fatal error: Attempt to connect to database healthinsurancea_db on healthinsurancea#localhost failed in /home/healthin/public_html/lib/adodb.functions.php on line 61
Please inform me how to resolve this... Thanks
CPanel has an option, maybe with name 'remote database' or something similar. You should add your IP to this list where you tried to connect to it from.