Anope IRC Services
Anope Support => 2.0.x/1.9.x Support => Topic started by: Francesco on February 19, 2014, 02:40:37 PM
-
Hi all!
My question is this: is possible to use sql_authentication module with a remote mysql database or it works only with local database?
If it is possible, how should I do?
Thanks in advance
-
same way you would usually but using the remote IP's... you'll probably need to do something mysql/host side to enable remote connections to mysql as by default it's only meant for local connections.
-
you can configure different mysql connections :
module
{
name = "m_mysql"
mysql
{
/* The name of this service. */
name = "mysql/main"
database = "anope"
server = "127.0.0.1"
username = "anope"
password = "mypassword"
port = 3306
}
mysql
{
/* The name of this service. */
name = "mysql/forum"
database = "phpbb"
server = "forum.your-net.com"
username = "phpbb"
password = "mypassword"
port = 3306
}
}
and then configure m_sql_authentication to use the second connection:
module
{
name = "m_sql_authentication"
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
engine = "mysql/forum"
....
-
you can configure different mysql connections :
module
{
name = "m_mysql"
mysql
{
/* The name of this service. */
name = "mysql/main"
database = "anope"
server = "127.0.0.1"
username = "anope"
password = "mypassword"
port = 3306
}
mysql
{
/* The name of this service. */
name = "mysql/forum"
database = "phpbb"
server = "forum.your-net.com"
username = "phpbb"
password = "mypassword"
port = 3306
}
}
and then configure m_sql_authentication to use the second connection:
module
{
name = "m_sql_authentication"
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
engine = "mysql/forum"
....
I tried this, but when I /os reload my services an error appears in the log:
[Feb 19 10:33:50 2014] MySQL: Unable to connect to MySQL service mysql/forum: Can't connect to MySQL server on 'HOST' (4)
(of course I replaced HOST with the real host of my database)
What does this mean? What is that "4"?
-
I use sql_authentication with remote database.
You only change the server option.
mysql
{
/* The name of this service. */
name = "mysql/main"
database = "anope"
server = "remote.database.host"
username = "anope"
password = "mypassword"
port = 3306
}
In the remote server "remote.database.host" check that you are listening on your host IP.
Maybe mysqld is listening only on localhost.
-
Maybe mysqld is listening only on localhost.
In fact it was so :D
Thanks a lot!