# /usr/bin/mysqld_safe: No such file or directory

**URL:** https://discourse.roots.io/t/usr-bin-mysqld-safe-no-such-file-or-directory/11702
**Category:** trellis
**Created:** 2018-02-23T03:03:48Z
**Posts:** 3

## Post 1 by @jasperfrumau — 2018-02-23T03:03:48Z

Had and error :

`Feb 23 02:26:07 domain /etc/init.d/mysql[1993]: /etc/init.d/mysql: line 114: /usr/bin/mysqld_safe: No such file or directory` .

This happened during a mysql database server restart that failed. service mysql start did not work.  
Only `mysqld --datadir=/var/lib/mysql --user=mysql --socket=/var/run/mysqld/mysqld.sock` did.  
The mysqld\_safe is truly missing in `/usr/bin`.

What would you recommend to fix this? Will provisioning fix this issue? Or do I need to do a

```
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get install mysql-server
```

post backing up all? The former would be better I would say, especially if I can keep my databases on the server though I can back them up…

Also post Spectre patches at DO they recommend some changes. Have these been taking into account for the latest Trellis?

---

## Post 2 by @swalkinshaw — 2018-02-23T04:28:08Z

That’s pretty weird…

If you’ve backed everything up I’d try removing those packages:

```
sudo apt-get purge mariadb-client mariadb-server
```

Then re-provision your server and re-import the DB after. You could give that a try and if it doesn’t work you might have to just do re-create a new server.

> [@jasperfrumau](#):
>
> Also post Spectre patches at DO they recommend some changes. Have these been taking into account for the latest Trellis?

That’s mostly just a Ubuntu thing. If you redo a new server you’d have the updates.

---

## Post 3 by @jasperfrumau — 2018-02-23T05:36:55Z

I recall I had to re-add the client to do mysql dumps. So perhaps something changed there. When I try to purge these packages I am told they have not been installed. MariaDB is up and running and databases are there.:

```
mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 221
Server version: 10.0.33-MariaDB-1~trusty mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
```

so it must have been installed differently. This also causes issues running dpkg while provisioning. I am told to run `dpkg --configure -a` and get:

```
Setting up mariadb-server-10.2 (10.2.13+maria~xenial) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package mariadb-server-10.2 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.2 (>= 10.2.13+maria~xenial); however:
  Package mariadb-server-10.2 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mariadb-server-10.2
 mariadb-server
```

I can always wipe the server post backing up all uploads and so on but prefer to see if I can remove this "rogue MariaDB and let Trellis install its own… Trying to figure out how to remove the current now and get around this issue.
