{"id":11,"date":"2011-08-22T05:15:51","date_gmt":"2011-08-22T05:15:51","guid":{"rendered":"https:\/\/sleepysoft.net\/?p=11"},"modified":"2011-08-22T17:30:28","modified_gmt":"2011-08-23T00:30:28","slug":"cron-mysql-error","status":"publish","type":"post","link":"https:\/\/sleepysoft.net\/index.php\/2011\/08\/22\/cron-mysql-error\/","title":{"rendered":"Cron MySQL Error"},"content":{"rendered":"<p>After completing the setup of my new VM, I was getting the following error daily and decided to try and fix it.<\/p>\n<p>The error:<br \/>\n<code>\/etc\/cron.daily\/logrotate:<br \/>\n[MM\/DD\/YYYY hh:MM:SS] [warn] NameVirtualHost ***.***.***.***:** has no VirtualHosts<br \/>\nerror: error running shared postrotate script for '\/var\/log\/mysql.log \/var\/log\/mysql\/mysql.log \/var\/log\/mysql\/mysql-slow.log '<br \/>\nrun-parts: \/etc\/cron.daily\/logrotate exited with return code 1<\/code><\/p>\n<p>I googled <a href=\"http:\/\/www.google.com\/search?q=ubuntu+error%3A+error+running+shared+postrotate+script+for\" target=\"_blank\"><em>ubuntu error: error running shared postrotate script for<\/em><\/a> and tried the fix explained on <a title=\"Logrotate fix\" href=\"http:\/\/www.lornajane.net\/posts\/2008\/Logrotate-Error-on-Ubuntu\" target=\"_blank\">this website<\/a> (first result).<\/p>\n<p>Basic steps listed on the website:<\/p>\n<ol>\n<li>Find user that runs job in <del><code>\/etc\/logrotate.d\/mysql-server<\/code><\/del><code> <\/code><code>\/etc\/mysql\/debian.cnf<\/code><del><code><br \/>\n<\/code><\/del><\/li>\n<ol>\n<li>Record password for <code>debian-sys-maint<\/code><\/li>\n<\/ol>\n<li>Run query<\/li>\n<ol>\n<li><code>GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY PASSWORD 'xxxxxxxxxxxxxxxx';<\/code><\/li>\n<\/ol>\n<\/ol>\n<p>I hope this fixes the problem.<\/p>\n<p>Edit #1: Posted the wrong file.<\/p>\n<p>Edit #2: Didn&#8217;t work. Did some digging around MySQL and found the password might be incorrect. I did the following and will post back if I continue to get the error.<\/p>\n<ol>\n<li><code>show grants for 'debian-sys-maint'@'localhost';<\/code><\/li>\n<ol>\n<li>Noticed the password was different from the one inside the file posted above<\/li>\n<\/ol>\n<li><code>set password for 'debian-sys-maint'@'localhost' = PASSWORD('**********');<\/code><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>After completing the setup of my new VM, I was getting the following error daily and decided to try and fix it. The error: \/etc\/cron.daily\/logrotate: [MM\/DD\/YYYY hh:MM:SS] [warn] NameVirtualHost ***.***.***.***:** has no VirtualHosts error: error running shared postrotate script for &hellip; <a href=\"https:\/\/sleepysoft.net\/index.php\/2011\/08\/22\/cron-mysql-error\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[7,10,9,8],"_links":{"self":[{"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/posts\/11"}],"collection":[{"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":11,"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/posts\/11\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sleepysoft.net\/index.php\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}