# Can't start MySQL/MariaDB after v 142 moved data

**URL:** https://dietpi.com/forum/t/cant-start-mysql-mariadb-after-v-142-moved-data/900
**Category:** Troubleshooting
**Created:** [17 January 2017 12:16 UTC](https://dietpi.com/forum/t/cant-start-mysql-mariadb-after-v-142-moved-data/900 "2017-01-17T12:16:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![qnx](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/c68b51/32.png) [@qnx](https://dietpi.com/forum/u/qnx)
#### Post date: [17 January 2017 12:16 UTC](https://dietpi.com/forum/t/cant-start-mysql-mariadb-after-v-142-moved-data/900/1 "2017-01-17T12:16:15Z")

</div>

Hi! First and foremost, thanks for this fantastic project!

I ran into a problem upon upgrading to v 142. During the installation DB data (MariaDB) was moved to dietpi\_userdata and I got a bunch of errors as my user data partition was full. I guess it didn’t move everything, as I have a couple of 0 bytes files in /var/lib/mysql (the symlink that is).

So I decided to move DB data back to the SD card and followed description [in this thread](https://dietpi.com/forum/t/mysql-mariadb-option-to-opt-out-user-data-location/895/1).

Now /var/lib/mysql isn’t a symlink anymore, but I can’t start the service, nor do mysql\_upgrade to check the tables. Here’s what I get:

```nohighlight
root@jpi:/etc/mysql# service mysql start
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.
root@jpi:/etc/mysql# systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: failed (Result: exit-code) since Tue 2017-01-17 13:05:34 CET; 44s ago
  Process: 12915 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Jan 17 13:05:03 jpi mysqld[13079]: 170117 13:05:03 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Jan 17 13:05:03 jpi mysqld[13079]: 170117 13:05:03 [ERROR] Unknown/unsupported storage engine: InnoDB
Jan 17 13:05:03 jpi mysqld[13079]: 170117 13:05:03 [ERROR] Aborting
Jan 17 13:05:03 jpi mysqld[13079]:
Jan 17 13:05:03 jpi mysqld[13079]: 170117 13:05:03 [Note] /usr/sbin/mysqld: Shutdown complete
Jan 17 13:05:03 jpi mysqld[13079]:
Jan 17 13:05:34 jpi mysql[12915]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Jan 17 13:05:34 jpi systemd[1]: mysql.service: control process exited, code=exited status=1
Jan 17 13:05:34 jpi systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Jan 17 13:05:34 jpi systemd[1]: Unit mysql.service entered failed state.
root@jpi:/etc/mysql# mysql_upgrade
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
FATAL ERROR: Upgrade failed

```

Where do I go from here?

---

<div class="post-metadata">

### Author: ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)
#### Post date: [17 January 2017 16:18 UTC](https://dietpi.com/forum/t/cant-start-mysql-mariadb-after-v-142-moved-data/900/2 "2017-01-17T16:18:15Z")

</div>

> [@qnx](#):
>
> I got a bunch of errors as my user data partition was full.  
> Where do I go from here?

Unfortunately, the patch system assumes you have the required space available for the move (usually \< 50MB for SQL datastore). We essentially dont check this, prior to the move as it felt unnecessary. However, clearly not the case ☹

So the problem now is during the move, the /var/lib/mysql folder is cleared, to make way for its symlink.

In short, your SQL databases are now potentially lost, or highly corrupted.

We’ll get this fixed for v143, preventing continuation of the move if it fails. Unfortunately, this does not help you now and we can only apologise for that.  
[https://github.com/Fourdee/DietPi/issues/715](https://github.com/Fourdee/DietPi/issues/715)

If you have a backup created by dietpi-backup, prior to the update, you will be able to restore system (and the SQL DB) to a previous state:  
[https://github.com/Fourdee/DietPi/issues/685#issuecomment-270145794](https://github.com/Fourdee/DietPi/issues/685#issuecomment-270145794)

---

<div class="post-metadata">

### Author: ![qnx](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/q/c68b51/32.png) [@qnx](https://dietpi.com/forum/u/qnx)
#### Post date: [18 January 2017 07:09 UTC](https://dietpi.com/forum/t/cant-start-mysql-mariadb-after-v-142-moved-data/900/3 "2017-01-18T07:09:46Z")

</div>

Oh, that’s a bummer, but bugs happen. Luckily, this wasn’t in critical production evnironment.

But what’s the preffered way to get back running? I understand that I’ll end up with a blank database - that’s ok. I had the Lighttpd/MariaDB/Wordpress/phpMyAdmin stack installed. Should I get rid of all the components, or would it be sufficient to uninstall and then reinstall MariaDB only?

---

<div class="post-metadata">

### Author: ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)
#### Post date: [18 January 2017 16:55 UTC](https://dietpi.com/forum/t/cant-start-mysql-mariadb-after-v-142-moved-data/900/4 "2017-01-18T16:55:43Z")

</div>

> [@qnx](#):
>
> or would it be sufficient to uninstall and then reinstall MariaDB only?

Yep, that should do it 🙂
