Koozali.org: home of the SME Server

MySQL 4.0 post-install changes

Offline johnwmcc

  • **
  • 25
  • +0/-0
MySQL 4.0 post-install changes
« on: January 03, 2005, 07:59:43 PM »
I have just installed a new SME 6.0.1 server (just as a server, behind a hardware firewall/router), and upgraded successfully with the general upgrade script from this site to provide MySQL 4.0.22, PHPMyAdmin, and several other useful goodies, including updated rpms for other packages.

I find that is is all ALMOST working the way I want, except that the mysqld daemon is running (PHPMyAdmin tells me) as root@localhost, and I want it to run as a user with more limited privileges (by convention called mysql on other distros).

I also had some trouble getting access from other computers on the local network to the mysql databases, but I think that was just getting the privileges right in MySQL. I have more work to do to sort this out fully, but at least I can connect.

As someone fairly new to Linux in general, and SME Server 6 in particular, I don't think I really know how to do this properly, without risking screwing up other things like Horde and mailserving.

I also want to make some changes to my.cnf, and am not really clear how to do that (though I know what the my.cnf file should look like - I want to enable running multiple mysqld instances and separate databases, and also replication).

I understand the general concept of templates, but don't know quite what template to edit or add as a custom one to make the relevant changes for the whole server to /etc/my.cnf. I can and will read more about that as soon as I can, in the SME Server documentation, but would welcome one or two relevant worked examples for this particular file.

I've searched this site for 'mysql' in different combinations with 'install', 'postinstall', '4' and '4.0' and can't find anything relevant.

Changing the user running mysqld from root to mysql may be the same as on other (later) Linux distros like Fedora, where you have to make sure there is a Linux user 'mysql' then chowner and chroot for the mysql database directories and executable folder. But it may not be quite the same, and I don't know exactly which directories these are anyway in SME server. Nor do I know what else may be dependent on the owner and permissions for 'mysqld.'

Can anyone point me in the right direction please? Thanks.

John McC

PS. I've had a basic SME v5.6 server just running e-mail and a web server on an extremely old Pentium II at home for nearly two years, and have hardly ever had to touch it! Very stable, and error free except that once a week I get an e-mail reporting two cron errors about a duplicate fetch-mail process, which I don't understand, but just ignore.

Offline gregswallow

  • *
  • 651
  • +1/-0
Re: MySQL 4.0 post-install changes
« Reply #1 on: January 04, 2005, 03:41:34 AM »
Quote from: "johnwmcc"
I understand the general concept of templates, but don't know quite what template to edit or add as a custom one to make the relevant changes for the whole server to /etc/my.cnf. I can and will read more about that as soon as I can, in the SME Server documentation, but would welcome one or two relevant worked examples for this particular file..

I describe making a my.cnf custom template in this howto - http://forums.contribs.org/index.php?topic=25414.0  

You basically have to look at the /etc/my.cnf file and in /etc/e-smith/templates/etc/my.cnf/ and see what you need to name your custom-template file.  eg. If there are files in /etc/e-smith/templates/etc/my.cnf/ called 009something and 011something then you can create a file in /etc/e-smith/templates-custom/etc/my.cnf/ called 010something, that will be inserted in between the other two.  

Another method is to copy 009something into /templates-custom/ and edit it, and it will replace the one in /templates/ when the template is expanded.

Expand with the command
Code: [Select]
/sbin/e-smith/expand-template /etc/my.cnf and then check /etc/my.cnf looks right.


Code: [Select]
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
...should enable remote access

Hope that helps.

Maybe someone else has some info on the root vs. mysql user question - I have no clue on that.

Offline johnwmcc

  • **
  • 25
  • +0/-0
MySQL 4.0 post-install changes
« Reply #2 on: January 04, 2005, 10:39:24 AM »
Many thanks for this reply.

I'll work on it further, today and tomorrow, but I now know where to look, and have made one successful change (to 'php.ini') using the template mechanism, so have a good deal more confidence now to go ahead with changing 'my.cnf'.

John McC

Damian

MySQL 4.0 post-install changes
« Reply #3 on: January 05, 2005, 03:17:43 AM »
John,

Make sure you have the following entry in /etc/my.cnf:

[mysql.server]
user=mysql
basedir=/var/lib

Also, on this system (SME 6.0) everything under /var/lib/mysql/ is owned by mysql:mysql.
Have a look at http://www.bugzilla.org/docs/2.18/html/nonroot.html for more info.

Damian