Can't log on to MySQL with asteriskuser (solved)

Hi there,
I followed the instructions here: http://www.freepbx.org/support/documentation/installation/install-process-for-centos-5-1

mysql

GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO [email protected] IDENTIFIED BY ‘myastpassword’;

GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY ‘myastpassword’;

flush privileges;

\q

I have Freepbx working on Centos 5.3 and Asterisk 1.4, but I didn’t work installing it with the asteriskuser, so I installed it as follows:

./install_amp --username=root --password=mypassword

Now in /etc/amportal.conf I have:

AMPDBUSER=root
AMPDBPASS=mypassword

When I try to change the AMPDBUSER=asteriskuser and AMPDBPASS=myastpassword FreePBX doesn’t work, saying it can’t connect to the DB. When I change it back to root, it works again.

When I do this:
mysql -u asteriskuser -p
I enter the password resquested and I get the following:
ERROR 1045 (28000): Access denied for user [email protected]

Is this a DNS issue? How can I fix this?

Thanks for your help.

The script had the following missing:

CREATE USER [email protected] IDENTIFIED BY ‘myastpassword’;

I ran it before:

GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO [email protected] IDENTIFIED BY ‘myastpassword’;

GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY ‘myastpassword’;

And now it all works.