mysql setup issue

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

mysql setup issue

Wade Smart-2
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

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: mysql setup issue

Wade Smart-2
I also tried this:

https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
--
Registered Linux User: #480675
Registered Linux Machine: #408606
Linux since June 2005
On Thu, Aug 23, 2018 at 3:15 PM Wade Smart <[hidden email]> 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');
>
> 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

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: mysql setup issue

Colin Law
In reply to this post by Wade Smart-2
On Thu, 23 Aug 2018 at 21:17, Wade Smart <[hidden email]> 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

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: mysql setup issue

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

On Thu, Aug 23, 2018 at 3:58 PM Colin Law <[hidden email]> wrote:

>
> On Thu, 23 Aug 2018 at 21:17, Wade Smart <[hidden email]> 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

Thanks Colin.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: mysql setup issue

Colin Law
On Thu, 23 Aug 2018 at 22:26, Wade Smart <[hidden email]> wrote:

>
> On Thu, Aug 23, 2018 at 3:58 PM Colin Law <[hidden email]> wrote:
> > ...
> > This is the technique I found
> > sudo -i
> > mysql
> > alter user 'root'@'localhost' identified by 'thepassword';
> > bye
> > exit
> >
> > Colin
>
> Thanks Colin.

Did that work? Having looked at my notes again I see I actually had to do
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY
'mypassword';

There was a thread about this a couple of months ago
https://lists.ubuntu.com/archives/ubuntu-users/2018-July/294296.html

Colin



>
> --
> ubuntu-users mailing list
> [hidden email]
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: mysql setup issue

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

On Fri, Aug 24, 2018 at 2:31 AM Colin Law <[hidden email]> wrote:

>
> On Thu, 23 Aug 2018 at 22:26, Wade Smart <[hidden email]> wrote:
> >
> > On Thu, Aug 23, 2018 at 3:58 PM Colin Law <[hidden email]> wrote:
> > > ...
> > > This is the technique I found
> > > sudo -i
> > > mysql
> > > alter user 'root'@'localhost' identified by 'thepassword';
> > > bye
> > > exit
> > >
> > > Colin
> >
> > Thanks Colin.
>
> Did that work? Having looked at my notes again I see I actually had to do
> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY
> 'mypassword';
>
> There was a thread about this a couple of months ago
> https://lists.ubuntu.com/archives/ubuntu-users/2018-July/294296.html
>
> Colin

I was reading something I had found in another forum that said the same thing.
It did work with all caps.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: mysql setup issue

Colin Law
On Fri, 24 Aug 2018 at 10:10, Wade Smart <[hidden email]> wrote:

>
> --
> Registered Linux User: #480675
> Registered Linux Machine: #408606
> Linux since June 2005
>
> On Fri, Aug 24, 2018 at 2:31 AM Colin Law <[hidden email]> wrote:
> >
> > On Thu, 23 Aug 2018 at 22:26, Wade Smart <[hidden email]> wrote:
> > >
> > > On Thu, Aug 23, 2018 at 3:58 PM Colin Law <[hidden email]> wrote:
> > > > ...
> > > > This is the technique I found
> > > > sudo -i
> > > > mysql
> > > > alter user 'root'@'localhost' identified by 'thepassword';
> > > > bye
> > > > exit
> > > >
> > > > Colin
> > >
> > > Thanks Colin.
> >
> > Did that work? Having looked at my notes again I see I actually had to do
> > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY
> > 'mypassword';
> >
> > There was a thread about this a couple of months ago
> > https://lists.ubuntu.com/archives/ubuntu-users/2018-July/294296.html
> >
> > Colin
>
> I was reading something I had found in another forum that said the same thing.
> It did work with all caps.

It isn't so much the caps as whether you needed the
WITH mysql_native_password

That wasn't in my first post.

Colin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: mysql setup issue

Wade Smart-2
> > I was reading something I had found in another forum that said the same thing.
> > It did work with all caps.
>
> It isn't so much the caps as whether you needed the
> WITH mysql_native_password
>
> That wasn't in my first post.
>
> Colin

Uh.. it wasnt. I didnt even notice because I saw your post on one
screen and the post from
the other forum on the other and they looked the same at quick
glance.. I wrote the right
thing :)  Hey, Im just glad its working. I went on for years on my old
system just updating
and upgrading so I do not install certain apps more than one or two
times. Im happy - and
Im working today. All is good.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users