Connect with remote mysql database

I’m trying to edit /etc/amportal.conf to connect freepbx with remote mysql database. The problem is when I edit the file and do ‘amportal restart’ the file return to options that were before edition.

Why is this and how to do fix it?

That file is there for legacy reasons. You would adjust this in advanced settings

Thank you for the answer. Where exactly is this in Advanced settings? I can’t find it…

in the UI under settings

There is nothing in the Advanced Settings for mysql or database at all…

No one can help with this?

Hi!

Try setting “Display Readonly Settings” and “Override Readonly Settings” to Yes…

It will show settings which are normally hidden…

Good luck and have a nice day!

Nick

1 Like

Thank you!
Now I saw settings for the remote database usage and set them. Question is why there is still nothing in the database?
Do I need some more configurations on dialplan or something in order to start saving CDR’s?

From the machine where are asterisk and FreePBX I’m able to connect to remotely database via console:

mysql -h REMOTE_HOST -u mysql -p asteriskcdrdb

Hi!

I have never ever tried to do that, I just knew that you could set them there because I had a problem with that in the past…

That said, did you create (or restored from a backup) the cdr and cel tables in that remote database?

Good luck and have a nice day!

Nick

From man mysql:-

· --password[=password], -p[password]

       The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option
       on the command line, mysql prompts for one.

       Specifying a password on the command line should be considered insecure. See Section 6.1.2.1, “End-User Guidelines for Password Security”. You can use an option file to avoid giving the password on the command line.

from your GUI please post all the lines you entered from the “Remote CDR Database” because as the request is from the asterisk user, a better test might be to post the issue of:-

su asterisk -c ‘mysql -h MYREMOTEHOST -P MYPORT -u MYUSER --password=MY_PASSWORD -e “describe MYDATABASENAME.MYTABLE”’

It should check the connection from asterisk, as the user and password you set up, the existence of both the asteriskcdrdb database and the strucure of the contained table cdr. If anything fails then you need to fix it.