Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-14-2014, 07:49 PM   #1
Registered: Sep 2004
Location: Wichita, KS
Distribution: Linux Mint 17
Posts: 57

Rep: Reputation: 15
Question Moving MySql data folder - can't start service after move.

I recently started to put ownCloud on my Pi and got it working but then decided to move the ownCloud storage and MySQL database to a external hard drive. Mainly to save the flash card from burning out since I was going to be pushing a lot of files around. I found multiple methods of moving the MySQL database online in only a few steps but I can never got the service to start. Below is the errors from the logs. MySQL shows that its a permission issue but even setting up the owner as "chown -R mysql:mysql /media/ownCloud/ownCloudData/mysql" permission is still a issue. I did think AppArmour was to blame but its doesn't look to be installed by default on Raspbian. Any ideas on what I'm missing?

datadir = /media/ownCloud/ownCloudData/mysql
innodb_data_home_dir = /media/ownCloud/ownCloudData/mysql

MySQL error.log
innodb: operating system error number 13 in a file operation
innodb: error means mysqld does not have the access rights to the directory
innodb: File name /media/ownCloud/ownCloudData/mysql/ibdata1
innodb: file operation call: 'create'

raspberrypi /etc/init.d/mysql[3031]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
raspberrypi /etc/init.d/mysql[3031]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
raspberrypi /etc/init.d/mysql[3031]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
raspberrypi /etc/init.d/mysql[3031]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Old 07-14-2014, 09:37 PM   #2
Senior Member
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
What about the permissions?
Old 07-15-2014, 11:43 AM   #3
Registered: Sep 2004
Location: Wichita, KS
Distribution: Linux Mint 17
Posts: 57

Original Poster
Rep: Reputation: 15
I have made sure the owner is MySQL using chown and it is granted r/w.
Old 07-28-2014, 07:16 PM   #4
LQ Newbie
Registered: Jul 2014
Distribution: openSuse 12.2, SLES11.3, RHEL 5,
Posts: 15

Rep: Reputation: Disabled
if you don't use the standard location for the socketfile (/tmp/mysql.sock) you should set "socket=path-to-socketfile" explicitly in your my.cnf both in mysqld AND in client sections, thats where mysqladmin is looking at when connecting from localhost. Otherwise you should provide a --socket=... when invoking a client program. You can find the location in the process string from "ps -ef | grep mysql", if it is set differently.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Moving only ONE MySQL database to a different folder, is it possible? lpallard Linux - Server 2 12-30-2012 01:01 PM
how to move content of folder moving to public_html ? cluepatel Linux - Newbie 4 03-25-2011 12:59 PM
After moving mysql db to NFS[netapp] unable to start mysql server throws error naveenrajn Linux - General 3 09-13-2010 03:20 AM
No access rights to delete or move files after re-install and moving from user folder sonicboy Ubuntu 5 01-18-2010 04:28 AM
How to Move the data directory of Mysql to different Location lakshmi4linux Linux - Newbie 1 03-31-2009 07:25 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration