How connect to databse via Mysqli in phalcon

How can I connect to my mysql database via

new mysqli()?

http://php.net/manual/en/mysqli.construct.php

because I can't conect via new PDO().

Phalcon only supports PDO, what problem do you have using PDO?

I can't access remote mysql.

PDOException: SQLSTATE[28000] [1045] Access denied for user 'user'@'localhost' (using password: NO) .....



27.5k

looks like your db config credentials are wrong.

So, if that so, how can I conect remote mysql? any help is apprecaite.

looks like your db config credentials are wrong.



27.5k

Your app is trying to connect to foreign mysql server. And you get: access denied.

  • does your mysql server accept foreign connections (!= localhost) ?
  • are your connections credentials OK ("I can't access remote mysql" with error :"using password: NO") ?

I did try to connect another mysql name A via normal php code new PDO(),

it's showing connect success. But when I connect A via Phalcon it said:

PDOException: SQLSTATE[42000] [1044] Access denied for user 'username'@'%' to database 'dbname'

And as for mysql named B neither normal php code nor Phalcon can acccess.

I did try to connect another mysql name A via normal php code new PDO(),

it's showing connect success. But when I connect A via Phalcon it said:

PDOException: SQLSTATE[42000] [1044] Access denied for user 'username'@'%' to database 'dbname'

And as for mysql named B neither normal php code nor Phalcon can acccess.

Your app is trying to connect to foreign mysql server. And you get: access denied.

  • does your mysql server accept foreign connections (!= localhost) ?
  • are your connections credentials OK ("I can't access remote mysql" with error :"using password: NO") ?

My Database server is not support mysql, just support mysqli. I run tutorial, it show message "Exception: could not find driver". Please inclue mysqli in phalcon soon. Thanks