title: join two tables from two database in cakephp
body: <p>I have created two db and join two tables from two db. The query working in local but not working in live server and shows error like </p>
  
  <blockquote>
    <p>SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command
    denied to user</p>
  </blockquote>
  
  <p>and my code for join query :</p>
  
  <pre><code>$holiday_workings = $this-&gt;CompoffEntry-&gt;find('all', array(
  
              'joins' =&gt; array(
                      array(
                              'table' =&gt; 'Meds.employee_details',
                              'alias' =&gt; 'Emp_det',
                              'type'  =&gt; 'INNER',
                              'foreignKey'    =&gt; false,
                              'conditions'    =&gt; array('CompoffEntry.worked_on_period' =&gt; $holiday_period,'CompoffEntry.worked_on_date != ' =&gt; null,'CompoffEntry.employee_detail_id = Emp_det.employee_detail_id', 'Emp_det.emp_status = "A"',($department != 'all') ? 'Emp_det.department_id = '.$department : '',($roleId == 5) ? 'reporting_id = '.$user_id : ''),
                      ) 
              )
      ));
  </code></pre>