Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: mike_mattos on November 10, 2006, 10:37:14 PM

Title: connect to mysql over network still needs LocalNetworking
Post by: mike_mattos on November 10, 2006, 10:37:14 PM
This is an old "feature", I'm reposting this because my search didn't find the instructions, I had to read my old notes!
Mysql is limited to the local web services by default, for network access you have to do the following

# /sbin/e-smith/config show mysqld
mysqld=service
    LocalNetworkingOnly=yes
    status=enabled

* /sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
# /sbin/e-smith/expand-template /etc/my.cnf
# /etc/rc.d/init.d/supervise/mysqld stop
Stopping mysqld:                                           [  OK  ]

# /etc/rc.d/init.d/supervise/mysqld start
Starting mysqld:                                           [  OK  ]

Note that the SUPERVISE word is needed
Title: connect to mysql over network still needs LocalNetworking
Post by: william_syd on November 11, 2006, 12:33:06 AM
"LocalNetworkingOnly yes" gives acces via unix sockets only which can only be done on the same machine that mysqld is running on.

"LocalNetworkingOnly no" gives access via TCP and unix sockets so with the right ports opened you can access mysqld from anywhere.

I always thought you use
Code: [Select]
/etc/rc.d/rc7.d/S50mysqld start
and
Code: [Select]
/etc/rc.d/rc7.d/S50mysql stop
as this respects the db 'enabled' property.

Typing
Code: [Select]
/etc/rc.d/rc7.d/S50mysqld shows that the end result is the same as you posted.

The FAQ (http://www.smeserver.org/index.php?option=com_content&task=view&id=27&Itemid=25&lang=en) has some information under Databases.
Title: connect to mysql over network still needs LocalNetworking
Post by: mike_mattos on November 13, 2006, 05:45:57 PM
Syd,

the site search for 'localnetworking'  has no results from FAQ's, & the FAQ menu doesn't have an obvious link to databases!

Perhaps you could post the link to this thread?

thx  Mike
Title: connect to mysql over network still needs LocalNetworking
Post by: byte on November 13, 2006, 07:01:49 PM
Quote from: "mike_mattos"

Perhaps you could post the link to this thread?

thx  Mike


It is on the FAQ link that was posted scroll down to databases section you'll see...

Databases

How can I access mysql from LAN?
You can use PHPMyAdmin from within an Ibay on the SME box, but you can't connect to Mysql with ODBC connector or Mysql Administrator from the network without config changes. The mysql database daemon is configured by default to accept only local connections (i.e. it is not accessible via the local network or internet).
This is a security precaution, since mysql only requires access from localhost by default installations.

If you wish to enable local network access, execute the following commands on a SME Server shell as root:

/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
/sbin/e-smith/expand-template /etc/my.cnf
/etc/rc.d/init.d/mysqld restart

This issue is described here:
http://forums.contribs.org/index.php?topic=29639.msg123869#msg123869 and is documented in http://bugs.contribs.org/show_bug.cgi?id=339