mysql setup issue

Wade Smart wadesmart at gmail.com
Thu Aug 23 20:15:18 UTC 2018


I installed mysql on my new system (18.04). Ive followed the
steps to install but at no point have I been able to access mysql
to set the password. Im run into one of two errors:

ERROR 1698 (28000): Access denied for user 'root'@'localhost'
or
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)

when following this:

Set mysql root password
Before accessing the database by console you need to type:
$ mysql -u root

At the mysql console type:
$ mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

After a few hours I removed mysql server completely, rebooted,
installed and had the
same problem. I cant figure a way around setting the initial password.
The instructions
to reset a forgotten root pw say:

Stop the mysql demon process using this command :
   sudo /etc/init.d/mysql stop

Start the mysqld demon process using the --skip-grant-tables option
with this command
   sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

$ sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
$ [1] 5799
mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
[1]+  Exit 1                  sudo /usr/sbin/mysqld
--skip-grant-tables --skip-networking

What to do next?
Wade


-- 
Registered Linux User: #480675
Registered Linux Machine: #408606
Linux since June 2005




More information about the ubuntu-users mailing list