[00:00] you're referring to /var/log/mysql/ error log? [00:00] arooni: I guess so [00:00] because i dont see any entry there [00:01] arooni: is any logging configured in my.cnf? and anyway, how exactly did you change the data dir? [00:04] was folllowing https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-16-04 [00:08] arooni: so first things first, put the apparmor profile in complain mode, see if that fixes it. [00:10] im googlign that [00:11] i'm not sure how to use sudo aa-complain /path/to/bin/ that would be my path to mysql? [00:11] arooni: aa-complain usr.sbin.mysqld [00:13] ok thats done [00:13] where is the output of apparmor complaints its not in my mysql error log [00:14] arooni: journal, syslog. grep for "audit" [00:14] anyway, if it's in complain mode, then it won't block. if that fixes mysqld starting up, then it means you have to adjust the profile properly. [00:15] looking at that DO article, I think the problem is that it didn't reload the modified profile. I'm not sure just "restarting" AppArmor will do that. [00:15] I use apparmor_parser -r directly [00:16] https://gist.github.com/d5a532fb94c3ff118d2056091e8936db doesnt it mean its allowing stuff? [00:16] today is the first ive ever heard of apparmor [00:16] im a bit of a linux noob; excuse the noobness [00:19] yeah in complain mode it won't actually block, but will continue auditing. so, did that fix mysql service? [00:20] sadly no [00:20] ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) [00:20] gawd this is annoying and frustrating [00:20] it shouldnt be so damn hard just to move data directory [00:22] arooni: so you rsynced the original data dir to another location, changed 'datadir' directive of mysqld.conf and restarted the service? [00:23] arooni: check the new dir first. that rsync command looks wrong, no trailing slash on the source directory, it'd copy the directory over to the destination [00:23] i did arsync the original data [00:23] i changed datadir [00:23] in the config [00:23] check the destination dir you supposedly moved the files to, if it's correct [00:23] this was my rsync command sudo rsync -av /var/lib/mysql data/ [00:24] arooni: right, and now you have .../data/mysql/... right? [00:24] theres 3.6 gig there [00:24] so it looks to be all there [00:24] blackflow: its in /home/arooni/.mysql/data/mysql [00:25] and that exact path is what you put into "datadir" directive of mysqld.conf? [00:25] not /home/arooni/.mysql/data/ ? [00:26] that was my thought too [00:26] 90% of the time its a typo [00:26] mysql starts up just fine when its in the default directory [00:26] right, missing trailing slash on the src dir [00:26] you mean i screwed up my rsync? [00:26] arooni: oh another thing... check that all path elements are accessible to the mysqld user [00:26] or my path in my.cnf [00:27] https://gist.github.com/c63b27eaa35edd92c099238ebcdd4bbb [00:27] let me put it this way..... rsync /path/a /path/b/ will create /path/b/a/... and rsync /path/a/ /path/b/ will copy files under a/ to b/ [00:28] blackflow: so maybe i should redo the rsync [00:28] with full paths [00:29] doesn't matter, if this works for you. the question is only fi you want /home/david/.mysql/data/ or /home/david/.mysql/data/mysql/ [00:29] i dont honestly care [00:30] i think the files are all there; im just not sure why mysql cant find them [00:30] also check that /home, /home/david and /home/david/.mysql are accessible to the mysql user. those dirs are probably owned by david, so they ALL must have read and exec rights for "others" [00:30] i also need to eat dinner; but i get stubborn [00:30] ahhh [00:30] thats a good point [00:30] so lets ask this question [00:30] whats a better directory [00:30] why did you even move it? [00:30] maybe /home/mysql [00:30] blackflow: was trying to free up space on root partition [00:30] never again [00:31] if I had to do that, I'd create /home/mysql-data just for those files [00:31] and make it owned by "mysql:mysql" [00:31] see thats what a smart person would do [00:31] i always though that acls worked on linux like ; as long as the group/owner was there it didnt matter where it was [00:31] but i think the problem here is [00:32] the mysql user doesnt have access to /home/david let alone the sub dir its in [00:32] no no, i tmatters, ALL path elements must be accessible [00:32] ahhhhhhhhhhhhh ha [00:32] so that was the basic lack of knowledge i had [00:32] lets see if moving it to /home/msyql works better [00:32] yeah the kernel is checking them top-down, one by one [00:33] blackflow: is there anyway to test to see if the mysql user could access manually [00:33] i guess running su mysql [00:33] and then seeing if i could navigate there? [00:33] yeah that's one way [00:34] is there a better way [00:35] I wouldn't know [00:35] well [00:35] that fixed it [00:35] thanks for the hand holding :) [00:35] how do i turn off that apparmor complaining thing [00:35] don't forget to adjust the apparmor profile [00:35] i did :) [00:35] aa-enforce usr.sbin.mysqld [00:35] can you explain it like i'm 5 what the point of apparmor is [00:36] AA is mandatory access control (MAC). unlike traditional unix (discreet access control) with users, groups and rwx, in a MAC every SUBJECT (process) is checked for access (read, write, execute, create, ......) for any OBJECT (process, file, socket, ...) it wants to interact with. [00:37] so you write policies that say: proces X can READ path Y. or process X can execute binary Y at path Z, ... [00:37] it's a bit more complex, there's more than just filesystem paths involved, but that's the gist of it [00:37] makes sense; does all linux use that [00:37] or is it just ubuntu [00:38] *all linux distros [00:38] ubuntu takes extensive advantage of it. CentOS, Fedora, RHEL use another MAC system called SELinux [00:38] that's pretty much it, I don't know if any other distro makes the effort to enable and provide some default profiles for a MAC like AA or SELinux [00:39] at any rate, AppArmor is good. being MAC, your MySQL could get compromised and elevated to root, but root couldn't do anything that's not allowed by the profile. [00:40] that's the whole point of it. without it, if your mysqld became root, then it could access anything, because it's root, right? MAC doesn't care about users or groups, only about explicit access declared in the profiles. [00:40] or in other words, with a MAC profile, you render root unprivileged. [00:44] so they all have their apparmor equivalent [00:44] when you use MAC ; what is the abbreviation youre using [00:44] Mandatory Access Control [00:47] that makes sense [00:47] as i learn more about linux; seems its pretty well thought out; and secure [00:48] well, it has tools and means to make your computing environment reasonably secure, but it's never absolute. === minipini is now known as Guest39280 === beatzz_ is now known as beatzz === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === daughertyh90 is now known as __holden__ === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance === havenstance1 is now known as havenstance