[FATAL] Cannot connect to database trying to install FreePBX

Hi to all, this is the first time that I use this kind of programm. So on my PC I have installed CentOS and follow the tutorial of the wiki.freepbx and all went fine untill I did this command:
./install_amp --installdb --username=asteriskuser --password=password
after that the terminal give to me this error:
Connecting to database…FAILED
Try running ./install_amp --username=user --password=pass (using your own user and pass)
[FATAL] Cannot connect to database
So searching on the web, I found that one of the most problem is that asteriskuser haven’t the privileges to access the DB, so i garanted the priveleges. In fact in MySql if i digit “Show grants” it says that asteriskuser have all the privileges with all the DB. I thinked that the problem was the password that i used so with this command I checked my password “cat /etc/amportal.conf | grep -i ampdbpass” and it’s right. So, how can I resolve this?

RESOLVED
I just opened a new terminal and digit this:
mysql -u root -p
[ENTER YOU PASSWORD FOR MYSQL]
GRANT ALL PRIVILEGES ON . TO [email protected] IDENTIFIED BY ‘Password_of_asterisk_user’ WITH GRANT OPTION;