Hi
Unfortunately when I loaded this server I partitioned it in such a way that the root partition ran out of space so I moved the MYSQL database Directory to another partition.
MYSQL starts and runs fine but Virtualmin fails when backing up and when I try to manage the database from the virtual server. All websites can access the databases and other programs can connect to manage also.
The backup gives this error "Error: Couldn't read status information for table webid_bawtpayments ()
mysqldump: Couldn't execute 'show create table webid_bawtpayments
': Table '455074_bawt.webid_bawtpayments' doesn't exist (1146)"
manage databses gives this error "SQL show index from webid_bawtpayments
failed : Table '455074_bawt.webid_bawtpayments' doesn't exist"
I have changed 2 settings in Webmin -> Servers -> MySQL Database Server -> Module Config -> Path to MySQL databases directory and Webmin -> Servers -> MySQL Database Server -> MySQL Server Configuration -> Databases files directory
Is there another place to change it for Virtualmin?
I moved only the database folders and left the other files in the old location.
Webmin version 1.570 Virtualmin version 3.88 Pro Operating system Debian Linux 5.0 Perl version 5.010000 Path to Perl /usr/bin/perl BIND version 9.6 Postfix version 2.5.5 Mail injection command /usr/lib/sendmail -t Apache version 2.2.9 PHP version 5.2.6 Webalizer version 2.01-10 Logrotate version 3.7.1 MySQL version 5.0.51 ProFTPd version 1.31 SpamAssasssin version 3.2.5 ClamAV version 0.97.3
Regards Greg
Comments
Submitted by JamieCameron on Wed, 11/30/2011 - 19:26 Comment #1
Did you restart MySQL after making this change and moving the directory?
Submitted by xkeywee on Wed, 11/30/2011 - 19:38 Comment #2
Yes I have restarted MYSQL several times, it restarts with no errors.
Submitted by andreychek on Wed, 11/30/2011 - 19:46 Comment #3
Well, Virtualmin communicates with the MySQL service in order to access those databases... it never needs to directly view the directories.
So, the only reason you'd get those errors is if they're being returned by MySQL, as the MySQL service attempts to find those databases and tables. It appears that MySQL may be a little confused at the moment.
If you run this command from the command line, what output do you receive:
grep datadir /etc/mysql/my.cnf
Submitted by xkeywee on Wed, 11/30/2011 - 20:14 Comment #4
Hi
I get datadir = /home/mysql_databases
Submitted by andreychek on Wed, 11/30/2011 - 20:39 Comment #5
Another way to change the MySQL database location, rather than changing the datadir in MySQL, would be to move the databases elsewhere, then make /var/lib/mysql a symlink to your new location.
With that -- MySQL would still be looking at /var/lib/mysql, but the symlink would redirect it to the location you've moved them to.
Submitted by xkeywee on Wed, 11/30/2011 - 20:46 Comment #6
That is a great idea, never thought of that.
I will change that over tonight when I can shut down MySQL for a few minutes and let you know how I go.
Appreciate your assistance, as usual always very helpful.
Submitted by andreychek on Wed, 11/30/2011 - 22:24 Comment #7
Great, let us know how that works for you!
Submitted by JamieCameron on Wed, 11/30/2011 - 22:46 Comment #8
+1 to the symlink idea .. that's what I've done in the past.
Submitted by xkeywee on Thu, 12/01/2011 - 01:17 Comment #9
Thanks for all your help, it work perfectly.
Submitted by andreychek on Thu, 12/01/2011 - 08:34 Comment #10
Great, I'm glad it's working, thanks for letting us know!
Submitted by stels88 on Thu, 12/08/2011 - 10:12 Comment #11
for mysql better use bind instead of symbolic links, something like:
you also can set UID and GUI :) to get UID and GID use command "id mysql"
for example:
/home/mysql_databases /var/lib/mysql none defaults,bind,uid=27,gid=27 0 0
Submitted by Issues on Thu, 12/22/2011 - 10:18 Comment #12
Automatically closed -- issue fixed for 2 weeks with no activity.