# \[Help\] MySQL / MariaDB service doesn't start up

**URL:** <https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276>\
**Category:** Support\
**Tags:** mariadb, mysql, english\
**Created:** [July 2, 2022, 6:47pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276 "2022-07-02T18:47:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stelian](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Stelian](https://forum.yunohost.org/u/Stelian)\
**Post date:** [July 2, 2022, 6:47pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/1 "2022-07-02T18:47:11Z")

</div>

> **The “support” category is meant to ask for help or troubleshooting related to installing or using YunoHost or its applications.** It is **not** to ask assistance on general system administration, network administration or special use cases that goes beyond the scope of the project. If you wish to discuss more advanced use case, please post in the “Advanced Use Case” category.
> 
> **Before posting** , please :
> 
> - [Look for similar issues on this forum](https://forum.yunohost.org/search) using the error message.
> - If you did not already, consider searching / reading the [administrator documentation](https://yunohost.org/#/admindoc)
> - Take the time to say Hi and stay friendly, this is a forum and project 100% ran by volunteer human beings 😜

### My YunoHost server

**Hardware:** VPS bought online  
**YunoHost version:** 11.0.7 (testing)  
**I have access to my server :** Through SSH & through the webadmin

### Description of my issue

I can’t start the mysql service. [Here](https://paste.yunohost.org/alohubaper) are my logs. It happened when I tried to change the root password of the mysql root user to something custom to explore a bit. I didn’t anticipate that it could break something, though I think this is an error on my part.  
Any help appreciated as I am very new to server management.

---

<div class="post-metadata">

**Author:** ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)\
**Post date:** [July 7, 2022, 2:28pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/2 "2022-07-07T14:28:10Z")

</div>

I think you try to run mysql service in the same time an other mysql cli is running.

With `ps aux | grep mysql` you can identify the process that run mysql and kill it.

Restart your server should fix this too.

Note: if you have change the root password, you yunohost could be unable to install/backup/restore/upgrade/delete apps using mysql.

---

<div class="post-metadata">

**Author:** ![Stelian](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Stelian](https://forum.yunohost.org/u/Stelian)\
**Post date:** [July 7, 2022, 5:55pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/3 "2022-07-07T17:55:42Z")

</div>

Alright, I am restarting my server right now.  
Indeed, I can’t do anything you mentioned in my panel anymore, what should I reset my password to?

---

<div class="post-metadata">

**Author:** ![Stelian](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Stelian](https://forum.yunohost.org/u/Stelian)\
**Post date:** [July 7, 2022, 6:10pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/4 "2022-07-07T18:10:43Z")

</div>

Mysql seems to be booted up now, though (as you already mentioned) I still have the issue of connection not working.

---

<div class="post-metadata">

**Author:** ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)\
**Post date:** [July 7, 2022, 7:38pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/5 "2022-07-07T19:38:48Z")

</div>

Ok, but can you confirm that the mysql service is running ?

For the password, i don’t remember well the process to change that. Do you remember which things you have changed ?

---

<div class="post-metadata">

**Author:** ![Stelian](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Stelian](https://forum.yunohost.org/u/Stelian)\
**Post date:** [July 8, 2022, 7:14am UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/6 "2022-07-08T07:14:35Z")

</div>

It seems to run, there’s nothing strange in the logs as well, seems normal. Except for these lines in the log:

```auto
Jul 07 19:56:29 mariadbd[796]: 2022-07-07 19:56:29 5 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
Jul 07 19:56:29 debian-start[1420]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Jul 07 20:00:24 mariadbd[796]: 2022-07-07 20:00:24 71 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
Jul 08 03:56:48 mariadbd[796]: 2022-07-08 3:56:48 14 [Warning] Aborted connection 14 to db: 'etherpad_mypads' user: 'etherpad_mypads' host: 'localhost' (Got timeout reading communication packets)
Jul 08 03:56:48 mariadbd[796]: 2022-07-08 3:56:48 15 [Warning] Aborted connection 15 to db: 'etherpad_mypads' user: 'etherpad_mypads' host: 'localhost' (Got timeout reading communication packets)

```

 ![Screenshot](https://forum.yunohost.org/uploads/default/original/2X/a/a9911bd97b3e0faf27c31974196a279fff775cfd.png)  
If I remember correctly, I used this method:

```bash
sudo mysqld_safe --skip-grant-tables &

```

after I stopped the service. I then did either this:

```auto
use mysql;
update user set authentication_string=PASSWORD("mynewpassword") where User='root';
flush privileges;
quit

```

or this, but I am not really sure:

```auto
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'mynewpassword';

```

I think I’ve tried both though.

---

<div class="post-metadata">

**Author:** ![Stelian](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Stelian](https://forum.yunohost.org/u/Stelian)\
**Post date:** [July 8, 2022, 7:21am UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/7 "2022-07-08T07:21:03Z")

</div>

I think, as in the logs it says `using password: NO`, I should change it to have no password, though I am unsure.

---

<div class="post-metadata">

**Author:** ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)\
**Post date:** [July 8, 2022, 8:35am UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/8 "2022-07-08T08:35:30Z")

</div>

Try to remove this password:

```auto
systemctl stop mysql
sudo mysqld_safe --skip-grant-tables &
mysql

```

Dans l’invite de commande de mysql

```auto
use mysql;
update user set authentication_string=PASSWORD(""),plugin="unix_socket" where User='root';
flush privileges;
quit

```

Depuis l’invite bash, on redémarre mysql

```auto
killall mysqld_safe
systemctl restart mysql

```

Il faut ensuite vérifier qu’un autre utilisateur ne peut pas se connecter en root

```auto
sudo -u admin mysql -uroot

```

---

<div class="post-metadata">

**Author:** ![Stelian](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Stelian](https://forum.yunohost.org/u/Stelian)\
**Post date:** [July 8, 2022, 11:59am UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/9 "2022-07-08T11:59:43Z")

</div>

```bash
MariaDB [mysql]> update user set authentication_string=PASSWORD(""),plugin="unix_socket" where User='root';
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
MariaDB [mysql]> flush privileges;                      
Query OK, 0 rows affected (0.001 sec)

MariaDB [mysql]> quit
Bye
root@yunohost:/home/admin# killall mysqld_safe
root@yunohost:/home/admin# systemctl restart mysql

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
root@yunohost:/home/admin#

```

Got this error when following your instructions, though I decided to continue anyways to see what would happen. Now it doesn’t want to start anymore again.

---

<div class="post-metadata">

**Author:** ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)\
**Post date:** [July 8, 2022, 3:25pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/10 "2022-07-08T15:25:58Z")

</div>

You should identify the process that make mysql running

```auto
ps aux | grep mysql

```

Next you can kill it

---

<div class="post-metadata">

**Author:** ![Stelian](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@Stelian](https://forum.yunohost.org/u/Stelian)\
**Post date:** [July 8, 2022, 5:15pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/11 "2022-07-08T17:15:57Z")

</div>

It was the same as before, only one process and everything is fine on reboot. Though I still get these errors:

```nohighlight
Jul 08 19:12:35 /etc/mysql/debian-start[1453]: Upgrading MySQL tables if necessary.
Jul 08 19:12:36 mariadbd[860]: 2022-07-08 19:12:36 4 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
Jul 08 19:12:36 /etc/mysql/debian-start[1462]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
Jul 08 19:12:36 /etc/mysql/debian-start[1462]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Jul 08 19:12:36 /etc/mysql/debian-start[1462]: FATAL ERROR: Upgrade failed
Jul 08 19:12:36 /etc/mysql/debian-start[1470]: Checking for insecure root accounts.
Jul 08 19:12:36 mariadbd[860]: 2022-07-08 19:12:36 5 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
Jul 08 19:12:36 debian-start[1473]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Jul 08 19:12:36 mariadbd[860]: 2022-07-08 19:12:36 0 [Note] InnoDB: Buffer pool(s) load completed at 220708 19:12:36

```

What I can get from this is that the password change didn’t happen. Is there a special way I have to change the password for MySQL when I also have MariaDB installed? Or is there something else wrong entirely that I might’ve broken when changing the password?

---

<div class="post-metadata">

**Author:** ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)\
**Post date:** [August 7, 2022, 5:16pm UTC](https://forum.yunohost.org/t/help-mysql-mariadb-service-doesnt-start-up/20276/12 "2022-08-07T17:16:52Z")

</div>

Closed on August 7, 2022, 5:16pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
