Cannot Create /var/log/mysql/error.log Directory Nonexistent
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of /var/log/mysqld.log permission denied this site About Us Learn more about Stack Overflow the company Business Learn
Chmod: Changing Permissions Of ‘/var/lib/mysql’: Operation Not Permitted
more about hiring developers or posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _
Chown: Changing Ownership Of `/var/log/mysqld.log': Operation Not Permitted
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute: Sign up Here's how
/var/log/mysql/error.log Permission Denied
it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Permission denied writing to mysql log up vote 3 down vote favorite I am just testing out a new Ubuntu (Vivid 15.04) install on Vagrant, and getting problems with mysql and logging to a custom location. In /var/log/syslog I get /usr/bin/mysqld_safe: cannot create /var/log/mysqld.log: Permission remove all --log-error configuration options for --syslog to take effect. denied If I ls -l /var I get drwxrwxr-x 10 root syslog 4096 Jun 8 19:52 log If I look in /var/log the file doesn't exist I thought I had temporarily disabled apparmor just to isolate if it was that or something else causing the problem, but not sure if its still creating an issue (edit: think it may still be enabled, so not sure if this is an issue or simple permissions). If I try manually creating the file as mysql I get denied as well (I temp allowed it bash access to test, I will remove after). touch /var/log/mysql.log touch: cannot touch ‘/var/log/mysql.log’: Permission denied If I look at another running server (centos) it has permissions as above (and writes as mysql user), so I'm wondering how does mysql normally get permissions to access the /var/log directory, and how can I get it to access that folder via normal running ? Here is my apparmor profile for mysql /usr/sbin/mysqld { #include #include #include #include #include capability dac_override, capability sys_resource, capability setgid, capability setuid, network tcp, /etc/hosts.allow r, /etc/hosts.deny r, /etc/mysql/** r, /usr/lib/mysql/plugin/ r, /usr/lib/mysql/plugin/*.so* mr, /usr/sbin/mysqld mr, /usr/share/mysql/** r, /var/log/mysqld.log rw, /var/log/mysq
by Mr Kevin Yank Build your Own Database driven website, I've also purchased the PHP Live course -I and I decided mysqld_safe can't log to error log and syslog at the same time to follow the individual packages installation procedure (I've had no mysqld_safe permission denied problems with WAMP or XAMPP in the past) but I wanted to learn more about MySQL mysqld_safe a mysqld process already exists PHP and Apache. I'm trying to install MySQL on a fresh Ubuntu 11.04 installation: everything ran smoothly untill the step described on page 20 for installing http://unix.stackexchange.com/questions/208328/permission-denied-writing-to-mysql-log mysql's database files with the following command: root@machine:/usr/local/mysql# scripts/mysql_install_db --user=mysql mysql returned an error telling that it could't find an .so file I don't remember the file right now but I did a search on the web and installed it via apt-get install then I repeated the command above and the database https://www.sitepoint.com/community/t/build-your-own-database-driven-website-by-kevin-yank-mysql-installation-problems/88707 files were installed. then I started mysql for the first time with the command provided by Mr Yank and got the following error: root@LIP-Y550:/usr/local/mysql# bin/mysqld_safe --user=mysql &[1] 3214root@LIP-Y550:/usr/local/mysql# 110803 04:10:14 mysqld_safe Logging to '/var/log/mysql/error.log'.touch: cannot touch /var/log/mysql/error.log': No such file or directory
chown: cannot access/var/log/mysql/error.log': No such file or directory110803 04:10:14 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysqlbin/mysqld_safe: 739: cannot create /var/log/mysql/error.log: Directory nonexistenteval: 1: cannot create /var/log/mysql/error.log: Directory nonexistent110803 04:10:14 mysqld_safe mysqld from pid file /var/lib/mysql/LIP-Y550.pid endedbin/mysqld_safe: 783: cannot create /var/log/mysql/error.log: Directory nonexistentroot@LIP-Y550:/usr/local/mysql# [1]+ Exit 2 bin/mysqld_safe --user=mysqlroot@LIP-Y550:/usr/local/mysql# then I tried to test if the server was running (I din't thought so) but I tried root@LIP-Y550:/usr/local/mysql# bin/mysqladmin -u root status and got: bin/mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists! there is no hostname.err file on mysql data directory to check what on e
have one accepted answer. Are you sure you want to replace the current answer with this one? Yes, I'm sure. Changed your mind? You https://www.digitalocean.com/community/questions/restoring-root-access-privileges-to-mysql previously marked this answer as accepted. Are you sure you want to unaccept it? Yes, I'm sure. Sign Up Log In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: stephenhamilton Subscribe Subscribed Share 0 Restoring root access privileges to MySQL April 24, permission denied 2015 8.7k views MySQL Linux Commands Ubuntu It appears I have revoked my root access privileges to MySQL on my DO Ubuntu (Forge) server. I have searched the web to find out how to restore them (http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html) but they appear to require permissions that I don't have when SSH'd into the server. Can anyone help me? Log In to Comment Leave operation not permitted a Comment Add comments here to get more clarity or context around a question. To answer a question, use the “Answer” field below. Log In to Comment 4 Answers 0 ryanpq MOD April 24, 2015 You should be able to do this by stopping the MySQL server and restarting it up in safe mode where you will not be prompted for a password. You can then restore your root details and restart the server to normal operation. This guide provides steps to reset a lost root password but once in safe mode you should be able to re-add the user account that was deleted and grant permissions. Reply Log In to Comment 0 stephenhamilton April 24, 2015 Ryan, Thanks for your quick response .. I was able to stop the MySQL server however the restart in safe mode failed (even when I did SUDO ...) forge@smooth-sands:/$ mysqld_safe --skip-grant-tables & [1] 2938 forge@smooth-sands:/$ 150424 10:16:25 mysqld_safe Can't log to error log and sys log at the same time. Remove all --log-error configuration options for --syslog to take effect. 150424 10:16:25 mysqld_