Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:53:07+00:00 2026-05-26T05:53:07+00:00

I am setting up Symfony2 and, as part of the process, using the PDO

  • 0

I am setting up Symfony2 and, as part of the process, using the PDO extension for the first time. I got it setup alright, but I am having a problem specifying my hostname in the DSN. The MySQL host is on a different server and I am including that in the DSN (say “beta.example.com”). Yet the error message returned always says that there was an access denied response at the local server (say “alpha.example.com”).

Just note: there is a MySQL server running local (on “alpha.example.com”), hence the access denied message, but the one I need to use is running on beta.example.com.

My DSN:

mysql:host=beta.example.com;port=3306;dbname=testdb;charset=UTF8

Here is a screenshot of the exact error attached (with hostnames modified to match my examples above):

https://skitch.com/nathanntg/gbrhx/pdo-exception

And it is not related to Symfony, it happens if I directly call the PDO creation from a blank PHP file:

<?
$a = new PDO('mysql:host=beta.example.com;port=3306;dbname=testdb;charset=UTF8', 'testuser', 'password');
?>

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045]      Access denied for user 'testuser'@'alpha.example.com' (using password: YES)' in -:2
Stack trace:
#0 -(2): PDO->__construct('mysql:host=beta…', 'testuser', 'password')
#1 {main}
thrown in - on line 2

Any help is greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:53:08+00:00Added an answer on May 26, 2026 at 5:53 am

    The “Access denied” message is generated by the contacted MySQL server and does not (necessarily) reflect the DNS name you’re using.

    Make sure that beta.example.com resolves to the host you’re using (with host beta.example.com). Also, the configuration on that MySQL server might be somehow messed up. If you log in to beta.example.com from beta.example.com, do you get the same error message?

    You can find out what host is contacted by creating a packet trace (for example with wireshark). A simple alternative is temporarily stopping (or firewalling) the MySQL server on beta.example.com and seeing whether the error message changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm setting up my first symfony project, and am having trouble with the schema.
Setting up TeamCity 5.0.1 to run unit tests for the first time, we're seeing
Setting onchange event for CheckBoxList using the following code doesn't work. chkListUserGroup.Attributes.Add(onchange, document.forms[0].isRecordModified.value='true';); How
Setting a Magento store for a winery. They well bottles of wine, but you
Setting up email details in web.config - but no email is being sent! <appSettings>
Setting: Multiplayer team game. Problem: Each player has a 1 to 5 star rating
Setting the style attribute to elements is not working in IE 6/7 . But
I have recently started setting up the security for my Symfony2 project. I opted
I have multiple symfony2 applications which share common entities, but use different database settings.
I'm setting up Capifony (Capistrano for symfony) but I've an issue with ssh password

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.