Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: allanr on January 19, 2011, 02:28:29 AM
-
Hi Folks,
If someone can tell me what I'm doing wrong, or give me a couple of pointers, or point me to where i need to read, it would be greatly appreciated ?
I've run the following commands :
config setprop mysqld LocalNetworkingOnly no
expand-template /etc/my.cnf
sv t /service/mysqld
config set mysqld service access public status enabled TCPPort 3306
signal-event remoteaccess-update
signal-event reboot
From the wiki page on sme mysql to access it from port 3306 rather than socket.
Works a treat, but when the server is re-booted, it's like I've lost the port setting and need to re-run the commands.
As a rather new, but competent, sme server convert, how can I get the change to 'stick', or what should I be searching for to find out what to do to make it stick ? At the moment we are utilising a mysql database across a dozen workstations on the lan and myself locally & remotely, but without running the commands after reboot, no one has access across the LAN or remotely.
Thanks in advance for any suggestions.
Cheers,
al.
-
For LAN access to mysqld, you only need to set 'LocalNetworkingOnly' to no, then create users with access from other IPs.
The second command - config set mysqld service access public status enabled TCPPort 3306 is only needed if you *also* want to allow remote access to your sql server from the Internet - these settings (access=public, status=enabled, TCPPort=3306) only affect the firewall (/etc/init.d/masq), and don't have any effect on /etc/my.cnf.
Here's a 'diff -u' showing what changes on my system when I change LocalNetworkingOnly from no to yes:-- my.cnf.LocalNetworkingOnly 2011-01-19 07:18:08.000000000 -0500
+++ /etc/my.cnf 2011-01-19 07:18:18.000000000 -0500
@@ -47,7 +47,7 @@
datadir=/var/lib/mysql
skip-innodb
socket=/var/lib/mysql/mysql.sock
-skip-networking
+# networking is enabled
log-error=/var/log/mysqld.log
max_allowed_packet=16M
user=mysql
Recommendations:
- Don't open the firewall unless you really need to. If you do, you probably also want to restrict access to a limited range of remote IPs (using, for example, config setprop mysqld AllowHosts a.b.c.d,x.y.z.0/24).
- Get mysqld access working as you want - save a copy of /etc/my.cnf - then reboot. After rebooting, check to see if /etc/my.cnf has changed, and if mysqld is still listening on port 3306 (netstat -an | grep \:3306)
-
Thanks for the pointers, Appreciate your help !
-
allanr
config setprop mysqld LocalNetworkingOnly no
expand-template /etc/my.cnf
sv t /service/mysqld
config set mysqld service access public status enabled TCPPort 3306
signal-event remoteaccess-update
signal-event reboot
These commands appear correct
Works a treat, but when the server is re-booted, it's like I've lost the port setting and need to re-run the commands.
Sounds like you are guessing, which is NOT a good way to troubleshoot.
Use db commands to interrogate the database settings & prove to yourself what the settings really are and that you did enter them correctly.
config show mysqld
Run the above before and after each set of commands and after a reboot
The db settings should remain unchanged after a reboot.
Please show the before and after settings from that command.
It the db settinge are truly changing after a reboot, then something else is causing it ie maybe a custom template.
-
Thanks Mary,
Fair points, will do, but I'm at a remote mine site for the coming week so I'll have to give it a nudge when I get back !
Cheers,
al.