Koozali.org: home of the SME Server

connect to mysql over network still needs LocalNetworking

Offline mike_mattos

  • *
  • 313
  • +0/-0
connect to mysql over network still needs LocalNetworking
« 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
...

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
connect to mysql over network still needs LocalNetworking
« Reply #1 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 has some information under Databases.
Regards,
William

IF I give advise.. It's only if it was me....

Offline mike_mattos

  • *
  • 313
  • +0/-0
connect to mysql over network still needs LocalNetworking
« Reply #2 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
...

Offline byte

  • *
  • 2,183
  • +2/-0
connect to mysql over network still needs LocalNetworking
« Reply #3 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
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!