Comments - I know this has been asked loads before, but...

6 years, 4 months ago Markus Mäkelä

Does the /mnt/database/mysql/ directory exist? Try running mkdir -p /mnt/database/mysql/ first if you're using a Linux OS.

 
6 years, 4 months ago Simon Markham

Hi Markus, Simple answer is yes. I have had no trouble getting it to work using the default installation.

Steps taken post successful default installation,

/etc/init.d/mysql stop
systemctl stop mariadb.service

remove error log rm /var/log/mysql/*

remove original error log rm /var/log/mysql/*

umount /dev/sda1
umount /mnt/usb_hd
mkfs.ext4 /dev/sda1 -L database
mkdir /mnt/database

Add Disk nano /etc/fstab add

/dev/sda1       /mnt/usb_hd      ext4    defaults        0       0
mount /dev/sda1 /mnt/database

save and exit

mount -a
rsync -a /var/lib/mysql /mnt/database/

edit my.cnf nano /etc/mysql/my.cnf add

[client-server]
socket  = /var/run/mysqld/mysqld.sock
port    = 3306
[mysqld]
datadir = /mnt/database/mysql/mysql
[mariadb]
datadir = /mnt/database/mysql/mysql

save and exit.

Reboot

 
6 years, 4 months ago Markus Mäkelä

Try setting datadir = /mnt/database, that way it points to the same place to where the rsync was done.

 
6 years, 4 months ago Simon Markham

Will do! I'm just rebuilding from the latest image (29/11/2017).. Yours Simon M.

 
6 years, 4 months ago Simon Markham

OK rebuilt and same result..

here are the steps

All from root

#### Installing MariaDB

apt-get install mariadb-server -y
sudo mysql_secure_installation

#### Installing phpMyAdmin

apt-get install phpmyadmin
/etc/init.d/php7.0-fpm reload && /etc/init.d/nginx reload
mysql -u root -p
use mysql;
update user set plugin = '' where User = 'root';
flush privileges;
exit;

Test phpmyadmin in the browser: http://raspberrypi/phpmyadmin/ Super double stop database!

service mysql stop && /etc/init.d/mysql stop && systemctl stop mariadb.service && systemctl stop mysql.service && systemctl stop mariadb && systemctl stop mysql then check for to see if its dead systemctl is-active mariadb.service move data rsync -a /var/lib/mysql /mnt/database/

No change, can anyone share there working my.cnf?

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.