mysql setup issue

Colin Law clanlaw at gmail.com
Thu Aug 23 20:56:22 UTC 2018


On Thu, 23 Aug 2018 at 21:17, Wade Smart <wadesmart at gmail.com> wrote:
>
> 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');
> ...

This is the technique I found
sudo -i
mysql
alter user 'root'@'localhost' identified by 'thepassword';
bye
exit

Colin



More information about the ubuntu-users mailing list