[asterisk-users] Ubuntu as remote MySQL server

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun May 25 23:16:08 CDT 2008


On Mon, May 26, 2008 at 11:59:11AM +0800, Ronald Wiplinger wrote:
> I have replaced a SuSE server with an Ubuntu 8.04 server.
> 
> The server runs MySQL, which is working locally. My Asterisk server
> (192.168.1.20) should access this MySQL server (192.168.1.254). I have
> left on the Asterisk server my old settings:
> [general]
> dbhost = 192.168.1.254
> dbname = myasterisk
> dbuser = myastuser
> dbpass = myastpass
> dbport = 3306
> dbsock = /var/lib/mysql/mysql.sock
> 
> In MySQL I have setup a record with
> 
> INSERT INTO `user` (`Host`, `User`, `Password`, `Select_priv`,
> `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`,
> `Reload_priv`, `Shutdown_priv`, `Process_priv`, `File_priv`,
> `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`,
> `Show_db_priv`, `Super_priv`, `Create_tmp_table_priv`,
> `Lock_tables_priv`, `Execute_priv`, `Repl_slave_priv`,
> `Repl_client_priv`, `Create_view_priv`, `Show_view_priv`,
> `Create_routine_priv`, `Alter_routine_priv`, `Create_user_priv`,
> `ssl_type`, `ssl_cipher`, `x509_issuer`, `x509_subject`,
> `max_questions`, `max_updates`, `max_connections`,
> `max_user_connections`) VALUES
> ('192.168.1.20', 'root', '**********************', 'Y', 'Y', 'Y', 'Y',
> 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
> 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', 0, 0, 0, 0);

And the reason you need to use such a priviliged user is?

Use mysqladmin or whatever to administrate the database. The Asterisk
mysql user does *not* need to have full control. If someone manages to
find a clever way to inject SQL commands through your CDR data, thoey
should not be able to toast your whole database at that opportunity.

> 
> However, the remote client (*.20) cannot connect to the server (*.254):
> [May 26 11:50:21] ERROR[3096]: res_config_mysql.c:651 mysql_reconnect:
> MySQL RealTime: Failed to connect database server myasterisk on
> 192.168.1.254 (err 2003). Check debug for more info.
> 
> What do I miss?

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list