Connect to Freepbx database remotely

Hi All
I followed the instruction provided here :Enable remote connection to asteriskcdrdb on freepbx - FreePBX Documentation - Documentation

everything seems okay, except accessing the main database hahhaa
when I try to access the database remotely, I only have access to the “test” database which doesn’t have any data, but locally when I login as my new user, I have access to the main database and I can list the tables, what I did wrong?
image

You need to connect with an mysql account/user previously created that has been given access to whatever from wherever appropriately

1 Like

Thanks dicko, so what’s the default root password for mysql? I haven’t added any other user before

FreePBX does not use a password for the root account, but it can only connect from localhost. (I can’t say I agree with that given the number or ‘compromises’ root has had over the years :wink: )

1 Like

oh right.
So what I did:
I logged in mysql as root
GRANT USAGE ON . TO ‘my_user’@‘localhost’ IDENTIFIED BY ‘mypassword’;

So do I need to put the public ip instead of localhost? that’s it?

localhost is 127.0.0.1, your remote host won’t be :wink:

and granting access to everything is never a good idea for any remote account.

1 Like

I added the permission to the public IP, but still can not remotely access to the main database, it’s just the test one
image

when you say;

are you referring to the public IP of the PBX or the public IP of the user trying to log in?

It needs to be the IP of the system that the request is coming from…

1 Like

on the firewall, I opened the port for my IP(client) but in mysql, the IP that I covered it by red pen, is the public IP for the mysql server.
Have I made a mistake?

From the client, I can have the access to the test database, but can not see the main database.

https://dev.mysql.com/doc/refman/8.0/en/creating-accounts.html (plus ingess/egress in your firewalls)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.