MYSQL and PHPMyAdmin setup ================================================================= Collation: Database "mecfsfmq" on emily created under Ubuntu Studio 11.04 is configured for latin1_swedish_ci collation. User/Group for mysql on US11.04: 118/127 User/Group for mysql on X12.04: 115/124 It was necessary to use ACLs in order for X12.04 to access the mecfsfmq directory and files created under US11.04 Flash! Mint uses completely different user/group again. ================================================================= mysql: ERROR 1045 (28000): Access denied for user 'staff'@'localhost' (using password: YES) PHPMyAdmin: #1045 Cannot log in to the MySQL server Having logged into phpmyadmin as root, go to the Privileges tab and delete user Any (this anonymous user is being selected by mysql when attempting to login as any user other than root). ================================================================= Changing UID and GID of a user (source: http://muffinresearch.co.uk/archives/2008/09/24/linux-changing-uids-and-gids-for-user/) Found: user group mysql mysql emily Ubuntu Studio 11.04 118 127 emily Xubuntu 12.04.1 115 124 emily Mint 13 Mate 117 111 emily Mint 17 Mate 191 192 presumably was changed immediately shuttle Ubuntu 10.04 Lucid 117 124 chloe Ubuntu Server 12.04 102 105 chloe Ubuntu Server 14.04 191 192 apparently survived dist-upgrade # Change the existing mysql uid/gid to a standard ---------------------- usermod -u groupmod -g find / -user -exec chown -h {} \; find / -group -exec chgrp -h {} \; usermod -g # Hence the following pattern: ---------------------- usermod -u 191 mysql groupmod -g 192 mysql find / -user -exec chown -h 191 {} \; find / -group -exec chgrp -h 192 {} \; usermod -g 192 mysql # if changing data directory, edit 'datadir' in /etc/mysql/my.cnf # if changing the mysql data directory, the following will be needed: # the following changes the home directory in /etc/passwd usermod -d mysql # Hence for Mint13 on emily: ---------------------- usermod -u 191 mysql groupmod -g 192 mysql find / -user 117 -exec chown -h 191 {} \; find / -group 111 -exec chgrp -h 192 {} \; usermod -g 192 mysql usermod -d /mnt/sysdata/Mint/mysql mysql # Hence for Ubuntu Studio 11.04 on emily: ---------------------- usermod -u 191 mysql groupmod -g 192 mysql find / -user 118 -exec chown -h 191 {} \; find / -group 127 -exec chgrp -h 192 {} \; usermod -g 192 mysql usermod -d /mnt/sysdata/US11.04/mysql mysql # Hence for Xubuntu 12.04.1 on emily: ---------------------- usermod -u 191 mysql groupmod -g 192 mysql find / -user 115 -exec chown -h 191 {} \; find / -group 124 -exec chgrp -h 192 {} \; usermod -g 192 mysql usermod -d /mnt/sysdata/X12.04/mysql mysql # Hence for Ubuntu 10.04 Lucid on shuttle: ---------------------- usermod -u 191 mysql groupmod -g 192 mysql find / -user 117 -exec chown -h 191 {} \; find / -group 124 -exec chgrp -h 192 {} \; usermod -g 192 mysql usermod -d /srv/mysql/U10.04L mysql ---------------------- # It is possible to bind-mount the nominal data-directory to the actual location # with an entry in /etc/fstab like one of the following --- # on emily: /srv/mysql/US11.04 /var/lib/mysql none bind /srv/mysql/X12.04 /var/lib/mysql none bind /srv/mysql/Mint13 /var/lib/mysql none bind /srv/mysql/Mint17 /var/lib/mysql none bind # symbolic links work for linking to the innodb files and database directories ---------------------- # Where apparmor is operating, the following needs to be added # to /etc/apparmor.d/usr.sbin.mysqld: /srv/mysql/innodb/ r, /srv/mysql/innodb/** rwk, /srv/mysql/database/ r, /srv/mysql/database/** rwk, # The actual data-directory will need to be added if it is not # bind-mounted to the nominal data-directory (specified in /etc/mysql/my.cnf) ---------------------- # If it proves necessary to change the ownership of the links to the innodb files # and database directories, chown needs the -h option. ---------------------- Farid • 11 months ago I observed that the setuid, setgid and sticky bits are not retained after chown and chgrp commands are run. I had to track down the special files and reset these bits. My advice is to list them before making the above changes. Here's a command that I used to create my list: find / \( \( -perm -4000 -o -perm -2000 -o -perm -1000 \) -a \( -group -o -user \) \) \ -printf "\n%p|%m\n" -ls 2> /dev/null ----------------------