title: How to install mysql to run as non-root
body: <p>I have tried to install mysql, and then to run with</p>
  
  <pre><code>mysql -u root -p
  </code></pre>
  
  <p>but I get </p>
  
  <pre><code>ERROR 1698 (28000): Access denied for user 'root'@'localhost'
  </code></pre>
  
  <p>I can get in with sudo, but I don't want to run as root. How do I get to run mysql as non-root?</p>
  
  <p>I am using Linux Mint 19.1 32-bit.</p>
  
  <p>What I tried:</p>
  
  <pre><code>sudo apt-get install mysql-client
  sudo apt-get install mysql-server
  
  sudo /etc/init.d/mysql restart
  sudo mysql_secure_installation
  </code></pre>
  
  <ul>
  <li>Set up VALIDATE PASSWORD? No</li>
  <li>Remove anonymous users? No</li>
  <li>Disallow root login remotely? Yes</li>
  <li>Remove test database and access to it? No</li>
  <li>Reload privilege tables now? Yes</li>
  </ul>
  
  <p>Then I try</p>
  
  <pre><code>mysql -u root -p
  </code></pre>
  
  <p>it asks for the password, I give the same one I gave in mysql_secure_installation...</p>
  
  <pre><code>frank@frank-laptop:~/WebDev$ mysql -u root -p
  Enter password: 
  ERROR 1698 (28000): Access denied for user 'root'@'localhost'
  </code></pre>
  
  <p>Gah.</p>
  
  <p>I have reinstalled mysql client and server several times now, doing a complete uninstall between and getting rid of all databases when asked. I don't get asked for a root password during the install. That seems to be normal for an install in Ubuntu and derivatives, hence the mysql_secure_installation to set the password.</p>
  
  <p>I tried following 
  <a href="http://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.html" rel="nofollow noreferrer">http://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.html</a>
  I tried searching on the web for hints, e.g.
  <a href="https://askubuntu.com/questions/766900/mysql-doesnt-ask-for-root-password-when-installing#766908">https://askubuntu.com/questions/766900/mysql-doesnt-ask-for-root-password-when-installing#766908</a>
  and others but I have not been able to get mysql to start without sudo. If I do use sudo I can create a database, add tables and add data so the database is installed, I just need more privilege to run it than I think I should need.</p>
  
  <p>Anywhere I looked, the instructions go from installation to starting mysql without anything special between, so I think I must be doing something quite stupid. But I have not been able to figure out what. </p>