title: redbean php: Fatal error: Uncaught exception 'PDOException' with message 'Could not connect to database
body: <p>I have a very strange problem:</p>
  
  <p>After deploying a small app to the prod server I am getting the following error:</p>
  
  <pre><code>Fatal error: Uncaught exception 'PDOException' with message 'Could not connect to     database.' in D:\inetpub\vhosts\DOMAIN\httpdocs\app\db\rb.php:194 
  Stack trace: 
  #0 D:\inetpub\vhosts\DOMAIN\httpdocs\app\db\rb.php(338): RedBean_Driver_PDO-&gt;connect() 
  #1 D:\inetpub\vhosts\DOMAIN\httpdocs\app\db\rb.php(5674): RedBean_Driver_PDO-&gt;setDebugMode(true, Object(RedBean_Logger_Default)) 
  #2 D:\inetpub\vhosts\DOMAIN\httpdocs\app\db\test.php(7): RedBean_Facade::debug(true) 
  #3 {main} thrown inD:\inetpub\vhosts\DOMAIN\httpdocs\app\db\rb.php on line 194
  </code></pre>
  
  <p>I double checked host, user, db name and password and everything looks good. </p>
  
  <p>I even created 2 php scripts:</p>
  
  <p><strong>//this one throws the error</strong></p>
  
  <pre><code>require('rb.php');
  R::setup('mysql:host=localhost;dbname=DBNAME', 'DBUSER','DBPASS'); //mysql
  R::debug(true);
  $testRecord = R::load('test', 1);
  echo $testRecord-&gt;name;
  </code></pre>
  
  <p><strong>//this one works fine</strong> </p>
  
  <pre><code>mysql_connect('localhost', 'DBUSER', 'DBPASS') or die(mysql_error());
  mysql_select_db('DBNAME') or die(mysql_error());
  $result = mysql_query("SELECT * FROM test")
  or die(mysql_error());  
  $row = mysql_fetch_array( $result );
  echo "Name: ".$row['name'];
  </code></pre>
  
  <p>what am I missing here? Please note that both scripts work fine on localhost. Also, localhost in a Linux machine while PROD is Windows. But why would that matter?</p>