title: Unable to access MYSQL from Command line MAC OSX YOSEMITE 10.10.5, MYSQL 5.7.19(not first install) + (PHPMYADMIN)
body: <p>(MYSQL installed from DMG and it is not my first install of MYSQL, maybe the 25th).</p>
  
  <p>MYSQL seems to be in healthy condition with PHPmyAdmin. Works fine.</p>
  
  <p>I am not understanding why access is permitted. </p>
  
  <p>At one point I was able to log in using <code>sudo mysqld_safe --skip-grant-tables</code> , now I can't.</p>
  
  <p>Mysql site provides clear instructions on creating an init file to initalise 'RESET FILE' for Windows users that I believe should fix the issue. None for the OSX users(maybe I'm blind). It must have something to do with permission settings.</p>
  
  <p>Would I need a <code>my.cnf</code> file into <code>/etc/</code> with the configuration that it knows where to find the PID file?(Unless its location is at <code>/usr/local/mysql</code> folder).</p>
  
  <p>Hopefully there is enough information here for someone to understand my issue.</p>
  
  <p>If my thread of assumptions/questions are unclear please do correct me, as I have browsed the net for the past 3 days and almost crying myself to sleep here.</p>
  
  <p>MYSQL from command line is prompting errors, such as listed below:</p>
  
  <p>1)Command entered:
  <code>/usr/local/mysql/support-files/mysql.server restart</code></p>
  
  <pre><code>ERROR! MySQL server PID file could not be found!
  Starting MySQL
  ./usr/local/mysql/bin/mysqld_safe: line 144: /usr/local/mysql/data/Martins-iMac.err: Permission denied
  /usr/local/mysql/bin/mysqld_safe: line 144: /usr/local/mysql/data/Martins-iMac.err: Permission denied
  /usr/local/mysql/bin/mysqld_safe: line 198: /usr/local/mysql/data/Martins-iMac.err: Permission denied
  /usr/local/mysql/bin/mysqld_safe: line 144: /usr/local/mysql/data/Martins-iMac.err: Permission denied
  ERROR! The server quit without updating PID file (/usr/local/mysql/data/Martins-iMac.pid).
  </code></pre>
  
  <p>Solution:
  Gave access to the specified <code>.err</code> file.</p>
  
  <p>2) <code>/usr/local/mysql/support-files/mysql.server restart</code></p>
  
  <pre><code>cat: /usr/local/mysql/data/Martins-iMac.pid: Permission denied
  ERROR! MySQL server process # is not running!
  override rw-r----- _mysql/_mysql for /usr/local/mysql/data/Martins-iMac.pid? y
  Starting MySQL
  ..................................................................................................... ERROR! The server quit without updating PID file (/usr/local/mysql/data/Martins-iMac.pid).
  </code></pre>
  
  <p>Aftermath:</p>
  
  <p>PID file has vanished.</p>
  
  <p>Full shutdown. No tears.</p>
  
  <p>3) Computer is back on, PID file is present but this time it changes from Martins-iMac.pid to localhost.pid, not sure why the name change happens.</p>
  
  <p>4)</p>
  
  <pre><code>Last login: Tue Jan 30 12:45:41 on console
  UNKNOWN:~ martintolmusk$ sudo /usr/local/mysql/support-files/mysql.server restart
  Password:
  ERROR! MySQL server PID file could not be found!
  Starting MySQL
  .Logging to '/usr/local/mysql/data/UNKNOWN.err'.
  .................................................................................................... ERROR! The server quit without updating PID file (/usr/local/mysql/data/UNKNOWN.pid).
  </code></pre>
  
  <p>(File UNKNOWN.pid doesn’t exist in my data folder however UNKNOWN.err does)</p>
  
  <p>*(In my preference pane I can see that MYSQL instance is running)</p>
  
  <p>Have I got more than 1 instance running?</p>
  
  <p>Sidenote: This is also present.</p>
  
  <p>AutoStarting MySQL on Reboot
  <code>sudo nano /Library/LaunchDaemons/com.mysql.mysql.plist</code></p>
  
  <pre><code>&lt;!--?xml version="1.0" encoding="UTF-8"?--&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
  &lt;key&gt;KeepAlive&lt;/key&gt;
  &lt;true /&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;com.mysql.mysqld&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
  &lt;string&gt;/usr/local/mysql/bin/mysqld_safe&lt;/string&gt;
  &lt;string&gt;--user=mysql&lt;/string&gt;
  &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>6) <code>UNKNOWN:~ martintolmusk$ mysql -u root -p</code></p>
  
  <pre><code>Enter password:
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
  </code></pre>
  
  <p>Using MYSQL generated password.</p>
  
  <p>Also tried my admin password without success.</p>
  
  <pre><code>UNKNOWN:~ martintolmusk$ mysql -u root
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  
  
  UNKNOWN:~ martintolmusk$ mysql -u martintolmusk
  ERROR 1045 (28000): Access denied for user 'martintolmusk'@'localhost' (using password: NO)
  UNKNOWN:~ martintolmusk$ mysql -u martintolmusk -p
  Enter password:
  ERROR 1045 (28000): Access denied for user 'martintolmusk'@'localhost' (using password: YES)
  </code></pre>
  
  <p>7)</p>
  
  <pre><code>UNKNOWN:support-files martintolmusk$ sudo /usr/local/mysql/support-files/mysql.server stop
  ERROR! MySQL server PID file could not be found!
  </code></pre>
  
  <p>Cannot get past this stage to begin with to possibly try and alter the password.</p>
  
  <p>Please advise.</p>
  
  <p>Kind regards,
  Martin</p>