We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

hi, I cannot change the database host value??

sorry, I'm not good at english. i will try my best to discribe.

here is a error log: [Thu, 11 Jun 15 16:04:17 +0800][ERROR] Message: SQLSTATE[HY000] [1045] Access denied for user 'tester'@'121.40.54.91' (using password: YES), Trace:

0 [internal function]: PDO->__construct('mysql:host=120....', 'tester', 'userps', Array)

the host ip '121.40.54.91' is the old one. now i change it to same like '120...*', but it seem i cannot change it.

as you can see, the log shows i change the host successfully, but it's not work.

my phalcon version is 1.3.4. i have reinstall it, but it's no use.

help me.

The database connection is OK by the looks of it. It's the user that's giving you problems:

This user ('tester'@'121.40.54.91') can only log in from 121.40.54.91. You need to create a new user 'tester'@'xxx.xxx.xxx.xxx' and replace the xxx. bits with your new IP address. Or you could define him as 'tester'@'%', % is a wildcard that will let you connect from any IP address.



391
Accepted
answer

refer to https://forum.phalcon.io/discussion/6652/phalcon-changed-my-mysql-database-host-address-and-cant-connect-

now i hown the reason.

the log "Access denied for user ...." is not from the phalcon but mysql.

any way, thank your reply, BadLuckBurt

The database connection is OK by the looks of it. It's the user that's giving you problems:

This user ('tester'@'121.40.54.91') can only log in from 121.40.54.91. You need to create a new user 'tester'@'xxx.xxx.xxx.xxx' and replace the xxx. bits with your new IP address. Or you could define him as 'tester'@'%', % is a wildcard that will let you connect from any IP address.