I want to safe the Databases on an Usbstick and not on my RaspberryPi.
First I did:
service mysql stop
mkdir /media/pi/EMTEC/mysql
nano /etc/mysql/my.cnf and changed datadir=/media/pi/EMTEC/mysql
cp -Rv /var/lib/mysql/* /media/usb4/mysql/
chown -R mysql:mysql /media/usb4/mysql/
which worked without problems
My my.cnf:
[client-server]
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
datadir=/media/pi/EMTEC/mysql
When trying to restart the mysql service I receive:
mysql: unknown variable 'datadir=/media/pi/EMTEC/mysql'
How do I fix that error?
Add datadir
to [mysqld]
section. datadir
is a global variable to configure mysql server.
[mysqld]
datadir=/your/new/dir/
Collected from the Internet
Please contact javaer1[email protected] to delete if infringement.
Comments