# Cannot change MySQL root password

**URL:** <https://forums.suse.com/t/cannot-change-mysql-root-password/28086>\
**Category:** SLES Configure-Administer\
**Created:** [April 18, 2016, 1:35pm UTC](https://forums.suse.com/t/cannot-change-mysql-root-password/28086 "2016-04-18T13:35:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlazzarotto91](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mlazzarotto91](https://forums.suse.com/u/mlazzarotto91)\
**Post date:** [April 18, 2016, 1:35pm UTC](https://forums.suse.com/t/cannot-change-mysql-root-password/28086/1 "2016-04-18T13:35:04Z")

</div>

Hi, I just installed MySQL from SLES repos, but during the installation MySQL didn’t asked me for root password to set.  
The problem is that I cannot change root password.  
I tried to launch the command mysql\_secure\_installation, but it asks me root password.  
On the Internet I found a lot of people that suggest to launch mysqld\_safe, but unfortunately I don’t find that command on my system.

And yes, I tried to use this command mysqladmin -u root passwrd , but it fails because I don’t provide him the actual root password.

The version of SUSE is SUSE Linux Enterprise Server 12 SP1, and the version of MySQL is 5.7.12.

---

<div class="post-metadata">

**Author:** ![smflood](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/smflood/32/10576_2.png) [@smflood](https://forums.suse.com/u/smflood)\
**Post date:** [April 18, 2016, 2:13pm UTC](https://forums.suse.com/t/cannot-change-mysql-root-password/28086/2 "2016-04-18T14:13:24Z")

</div>

On 18/04/16 11:44, mlazzarotto91 wrote:  
[color=blue]

> Hi, I just installed MySQL from SLES repos, but during the installation  
> MySQL didn’t asked me for root password to set.  
> The problem is that I cannot change root password.  
> I tried to launch the command mysql\_secure\_installation, but it asks me  
> root password.  
> On the Internet I found a lot of people that suggest to launch  
> _mysqld\_safe_, but unfortunately I don’t find that command on my system.
> 
> And yes, I tried to use this command _mysqladmin -u root passwrd_ , but it fails because I don’t provide him the actual root  
> password.
> 
> The version of SUSE is SUSE Linux Enterprise Server 12 SP1, and the  
> version of MySQL is 5.7.12.[/color]

With the release of SLES12 (and therefore also applies for SLES12 SP1)  
SUSE replaced MySQL with MariaDB[1] so MySQL isn’t available to install  
from SLES repos. Please can you therefore let us know where exactly you  
installed MySQL from?

## HTH.

Simon  
SUSE Knowledge Partner

* * *

## If you find this post helpful and are logged into the web interface, please show your appreciation and click on the star below. Thanks.

---

<div class="post-metadata">

**Author:** ![mlazzarotto91](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mlazzarotto91](https://forums.suse.com/u/mlazzarotto91)\
**Post date:** [April 18, 2016, 2:14pm UTC](https://forums.suse.com/t/cannot-change-mysql-root-password/28086/3 "2016-04-18T14:14:30Z")

</div>

[QUOTE=mlazzarotto91;32227]Hi, I just installed MySQL from SLES repos, but during the installation MySQL didn’t asked me for root password to set.  
The problem is that I cannot change root password.  
I tried to launch the command mysql\_secure\_installation, but it asks me root password.  
On the Internet I found a lot of people that suggest to launch mysqld\_safe, but unfortunately I don’t find that command on my system.

And yes, I tried to use this command mysqladmin -u root passwrd , but it fails because I don’t provide him the actual root password.

The version of SUSE is SUSE Linux Enterprise Server 12 SP1, and the version of MySQL is 5.7.12.[/QUOTE]

Ok, so I found that MySQL during the installation generated a temporary password in /var/log.  
But now, when I try to connect with the commadn mysql -u root -p, it returns the following error:

```auto
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
```

but the file mysql.sock doesn’t exist.

---

<div class="post-metadata">

**Author:** ![thsundel](https://avatars.discourse-cdn.com/v4/letter/t/13edae/32.png) [@thsundel](https://forums.suse.com/u/thsundel)\
**Post date:** [April 18, 2016, 3:25pm UTC](https://forums.suse.com/t/cannot-change-mysql-root-password/28086/4 "2016-04-18T15:25:32Z")

</div>

[QUOTE=mlazzarotto91;32229]Ok, so I found that MySQL during the installation generated a temporary password in /var/log.  
But now, when I try to connect with the commadn mysql -u root -p, it returns the following error:

```auto
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
```

but the file mysql.sock doesn’t exist.[/QUOTE]

Is mysql running?

Thomas

---

<div class="post-metadata">

**Author:** ![mlazzarotto91](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mlazzarotto91](https://forums.suse.com/u/mlazzarotto91)\
**Post date:** [April 19, 2016, 10:14am UTC](https://forums.suse.com/t/cannot-change-mysql-root-password/28086/5 "2016-04-19T10:14:31Z")

</div>

[QUOTE=smflood;32228]On 18/04/16 11:44, mlazzarotto91 wrote:  
[color=blue]

> Hi, I just installed MySQL from SLES repos, but during the installation  
> MySQL didn’t asked me for root password to set.  
> The problem is that I cannot change root password.  
> I tried to launch the command mysql\_secure\_installation, but it asks me  
> root password.  
> On the Internet I found a lot of people that suggest to launch  
> _mysqld\_safe_, but unfortunately I don’t find that command on my system.
> 
> And yes, I tried to use this command _mysqladmin -u root passwrd_ , but it fails because I don’t provide him the actual root  
> password.
> 
> The version of SUSE is SUSE Linux Enterprise Server 12 SP1, and the  
> version of MySQL is 5.7.12.[/color]

With the release of SLES12 (and therefore also applies for SLES12 SP1)  
SUSE replaced MySQL with MariaDB[1] so MySQL isn’t available to install  
from SLES repos. Please can you therefore let us know where exactly you  
installed MySQL from?

## HTH.

Simon  
SUSE Knowledge Partner

* * *

If you find this post helpful and are logged into the web interface,  
please show your appreciation and click on the star below. Thanks.  
------------------------------------------------------------------------[/QUOTE]

I got MySQL repositories from [here](https://dev.mysql.com/downloads/repo/suse/)

[QUOTE=thsundel;32232]Is mysql running?

Thomas[/QUOTE]  
I’ve just tried again, the service was “inactive (dead)”, after a restart of the service now I can login.
