Page 1 of 1

how to config databases to another drive?

PostPosted: 16. December 2018 09:27
by carsten888
I installed xxamp on c, but have my websites and databases on d:

I altered in sql ini
datadir="e:/_websites/xxamp-server-stuff/databases"

quit and restarted but doe snot show the new location.
What am I overlooking?

Re: how to config databases to another drive?

PostPosted: 16. December 2018 11:06
by Nobbie
Drive letters from USB Drives, Networks, NAS etc. are only known to the logged in Windows User, not to System User, which executes Apache when running as service. Do Not run Apache, Mysql etc. as service if you want to use Drive Letters for Network etc.

If you have your databases on d:, you must specify d: and not e: as well (see your description)

Re: how to config databases to another drive?

PostPosted: 16. December 2018 14:12
by carsten888
sorry, that was a typo. I got all data on D:, windows and apps on C:. Both are ssd-s in my laptop.

Re: how to config databases to another drive?

PostPosted: 19. December 2018 10:40
by carsten888
I tried again a few days later and it all of a sudden shows my databases in phpmyadmin.

When I creating a new database it all works.

But when in phpmyadmin I open tables of the old databases I get this error:

#1932 Table 'table_name' doesn't exist in engine

screenshot:
https://i.postimg.cc/PfzpyzDZ/Capture91.png

(my windows 10 broke, I ended up doing a fresh install, long story, so I got the databases which worked from D:, but all on C: was lost. Good thing I stored data on another drive then windows, but now getting sql to 'recognize' then in its mysteriuous 'engine'...)

how to fix those databases?

Re: how to config databases to another drive?

PostPosted: 19. December 2018 11:57
by Nobbie
Obviously, the ibdata files (i.e. ibdata1) is corrruptedt. Probably, you deleted it, or you overwrote it or whatever. This error typically comes, when a table is defined in a database (which is stored in the folder with the name of the database), but there is no more data for that table in ibdata1 (which is the proprietary file system for INNODB engine).

The ony fix for that is having a non-corrupted backup.

Re: how to config databases to another drive?

PostPosted: 19. December 2018 12:12
by Altrea
You could try to restore the ibdata1 file like described here:
http://zadpen.com/20-restore-lost-data- ... data1.html

I have never tried that on my own, so no warranties for data loss.

Re: how to config databases to another drive?

PostPosted: 20. December 2018 14:59
by carsten888
Nobbie wrote:Obviously, the ibdata files (i.e. ibdata1) is corrruptedt. Probably, you deleted it, or you overwrote it or whatever.

yes, had to reinstall windows, so lost all on C:/

Re: how to config databases to another drive?

PostPosted: 20. December 2018 15:01
by carsten888
Altrea wrote:You could try to restore the ibdata1 file like described here:
http://zadpen.com/20-restore-lost-data-in-mysql-using-innodb-engine-without-file-ibdata1.html

I have never tried that on my own, so no warranties for data loss.

Thank you. But I won't try that. Its per table! And I got like 10-15 Joomla databases. Nah. That will take days.

I will just download the databases from the live sites.

Re: how to config databases to another drive?

PostPosted: 20. December 2018 15:06
by carsten888
hard lesson learned:
An untested backup = no backup


Backing-up the database files is no way to backup databases. Just export to sql-files. So the whole idea of having the databases on another drive, so they would be easy to backup, was pointless. :?