Save Asterisk CDR to an external host - mysql

I'm trying to save Asterisk's CDR to an external mysql host.
I've modified the the connection details in the FreePBX advanced settings section,
and I also tried editing the cdr_mysql.conf file in /etc/asterisk,
but FreePBX still can not connect to the external mysql host.
When I'm trying to log into the UCP I get the failed to connect DB with the connection string.
It looks like the string FreePBX tries to connect with is wrong, becuase when I set up a test .NET web site to try and open a connection to mysql it works, but I am using a different syntax in the connection string.
BTW, I can telnet the external host from my pbx machine and I know for sure that this is not a network issue.
How can I have my CDR saved to an external mysql host?
**Edit: I also copied the db structure from the original mysql server so it won't be an issue.
Thank You!

Check connection string, check firewall
You can use
mysql -h hostname -u user -ppassword databasename
from command line to check connection is really allowed and no firewall.
You can get db access info from /etc/amportal.conf or /etc/asterisk/freepbx.conf
If you still have issues after that check, you can enable debug in logger.conf

Related

How to access my newly setup MySQL database (getting "Domain is currently unable to handle this request.")

I just set up a new MySQL database with the MySQL workbench & created a user for it with all necessary privileges. I am using this database for use with my php code. But I can't seem to connect to it on my live server (pages are hosted on windows server 2012). Everything works fine in my local environment with xampp and the new MySQL database is exactly the same as the xampp one. I think I am maybe using the wrong host name or something. As host name I copied the name that is displayed after "Host:" when you click on Server Status in MySQL workbench. The database name, user & password should all be correct. But when my code tries to access the db I get a "The domain page isn’t working. Domain is currently unable to handle this request."
You either have no network connection to the server at all or it is blocked due to firewall or routing misconfiguration.
If you do have network access in general, you might forgot to
FLUSH PRIVILEGES;
or you have not enabled networking over TCP, the default is to listen only to localhost (on unix systems via unix sockets, on microsoft I guess it's simply TCP).
Read about the following configuration parameter which will solve your networking issue:
bind-address
If you have a very old MySQL server version, the parameter is enable-networking but it shouldn't be the case anymore.

WordPress Error Establishing Connection on Temporary URL with Vesta VPS

I have a VPS(VestaCP) with a WordPress installation, and the domain is no longer available. I have set up a temporary URL Using the following instructions: Link
I now have an issue establishing connection.
I've went into the wp-config.php and added the following lines thinking it would solve my issue... But it didn't
// Add these lines to wp-config.php:
define('WP_SITEURL', 'http://*tempurlhere*-com.alpha.*myurl*.com/');
define('WP_HOME', 'http://*tempurlhere*-com.alpha.*myurl*.com/');
Is there something I'm missing? Should I replace the url with the server IP?
The reason for "ERROR ESTABLISHING DATABASE CONNECTION" is the inability of WordPress to reach MySQL or authenticate properly. Check the values of DB_USER,DB_HOST,DB_PASSWORD, and DB_NAME. Fix if needed. Make sure the user exists in MySQL, is allowed to connect from your web host, and has the rights to the database given by DB_NAME. If that does not solve the problem, check if MySQL server up and running. If yes, can it be reached from the web server (e.g. maybe MySQL port is firewalled)?
To check accessibility of the MySQL server from your web host, ssh to the web host, and run:
mysql -u <DB_USER> -p<DB_PASSWORD> -h <DB_HOST> <DB_NAME>
Replacing <var> with the actual values. Note the absence of space between -p and the DB_PASSWORD value.
If the connectivity is confirmed, double-check that you are editing the correct wp-config.php that WordPress is actually using, e.g by adding die("Loading this file now"); at the very top of it, then check if you see that message when you load the site.
If that is indeed the case, verify that the PHP installation includes a functional MySQL driver by writing an small program that will use mysqli_connect() with the relevant credentials and report success or error.

Connection failed in using mysqlconnector ODBC to connect from sql to access

I am trying to connect mysql database in phpmyadmin to the access file. I am using mysqlconnector ODBC for that. Tutorial I am following is this
The problem is that when I give the credentials to connect to database, it gives me error as shown in this snapshot
I have tried hard to search on internet but failed. What mistake I am doing. I am putting the ftp information of the server there. Is there any database credentials i need to put?
You can't use the FTP credentials to connect the MySQL database. You have to use the database credentials. Make sure you have done followings before connecting.
Make sure MySQL server is up and running on the HOST IP and PORT.
Your MySQL server can accept connections from your IP or use % for
all IPS
Make sure you have a valid USER account
EDIT
Or tell us where(local server, internet, IP) the MySQL database is installed. The port number the server is listening on. How you access MySQL server normally.

Cannot connect to MySQL Server database at localhost:3306

When I first set up MySQL Server in Netbeans everything worked well. Now one day I think I accidentally clicked something or my computer lost battery life when I was connected to MySQL Server, and after these event(s) I have not been able to connect to MySQL Server. I do not know for sure if either of the above events would have any effect on connecting to a MySQL Server database.
Anyway since these events I have found that I cannot "start" or "connect" to a MySQL Server databse. I am doing this all through Netbeans IDE.
Here is a picture of how I try to connect to my databaseL:
This is what the error message says after I click connect:
Unable to connect. Cannot establish a connection to jdbc:mysql://localhost:3306/twitterdata using com.mysql.jdbc.Driver(Unknown database 'twitterdata'). The name of the database I am trying to connect to is twitterdata
How can I get reconnected to the MySQL Server database "twitterdata"?
I am not familiar with MySQL, databases, servers and I have no idea how to get reconnected. If there is any other helpful information that I should provide let me know.
What MySQL tools can I run to find my problem?
Why would the error message tell me that the database is unknown?
If I got to C:\ProgramData\MySQL\MySQL Server 5.5\data. There is a folder named twitterdata.
Here are the contents of that directory:
Please let me know if you need more information or if you have other suggestions that would help!
Thanks for all the help!
If you are using windows system and facing the error 'unable to connect localhost 3306' at the connection time. First you have to need start MySQL services in 2 steps:
Press "Windows key + R" write "services.msc"
And run as admin start MySQL service.
There can be three issues:
1) Either your server isn't even running. Open your command prompt and enter mysql
2)Let's say it is , can you check if it's connecting on the correct port.
Like in the url, you are using 3306,
Try following this post:
How do I find out my MySQL URL, host, port and username?
3) Can you check what if there are any credentials to the database you are connecting?
https://netbeans.org/kb/docs/ide/install-and-configure-mysql-server.html

VB.net - Connect to Database

I got mysql database in the phpmyadmin, and i try to connect to the database from my application.
My connection string is:
Server=12.919.18.12;Port=3306;Database=hbd;Uid=hb;Pwd=123;
An exception occurs:
"Unable to connect to any of the specified MySQL hosts."
Do I need to install mysql or something?
(I just imported MySql.Data.dll and tryied it. Is there anything I have forgotten? I checked the ip pinging my website).
Connection strings for MySQL
is pretty helpful in terms of connection strings. Your connection
string seems to be invalid.
You may check mysql server is working or not and you can add port number of mysql in connection string like this
"Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"
Other reason MySql might be configured to listen to only the local host.
Follow the following links for more information:
Enabling MySQL Remote Access - MySQL connection only works from local machine
Unable to connect to any of the specified MySQL hosts.
IP is invalid 12.919.18.12
Server=12.919.18.12;Port=3306;Database=hbd;Uid=hb;Pwd=123;
IP block is < 256
If the datababase is local, try localhost or 127.0.0.1 as the IP address.
Is the server on your network? If so, the IP is invalid. If I were you, I'd try to check the IP with the person who gave it to you.
the connection string is correct but as ive read a lot of forums they all have the same problems as you do. my solution is that if your trying to create a network base system on a LAN type network you should use XAMPP or WAMPP but i prefer xampp and double check if your accounts or users have an Admin or any other user name for your connection and then see if they have granted all the privileges and with password of course.
Here is the ff instructions:
Open Xammp
Then open a web browser then open 127.0.0.1 or localhost.
click phpmyadmin then at the top click privileges.
add user and make it sure allow all privileges and check all access.
then connect again using the same connection string with the proper user and password.
This issue is RESOLVED :)
try to put the PORT in the end like :
"Server=12.919.18.12;Database=hbd;Uid=hb;Pwd=123;Port:3306;"