MySQL: Using Symbolic Links for Databases on linux
0
votes
0
answers
57
views
Someone gave me a database. It's (1) a folder containing files with the following extensions:
MYD
, MYI
, TRG
, TRN
, frm
, opt
; (2) a file with the sql-extension called db_add_nodata.sql
, and (3) a file called sphinx.conf
I have generated my database using the file with the sql-extension (am not sure what you call it, perhaps this file is called the sqldump?) in the following way:
mysql -u root -p < db_add_nodata.sql
Internally, it executes CREATE DATABASE 'technical1';
. And I find the folder technical1
in my data dir /var/lib/mysql/technical1
. I used the most recent version of the official documentation on the mysql website to try to create a soft link to the data which is on an external hard drive and mounted at such that the data are in /media/user/drive/data
:
$ mv technical1 /media/user/drive/
$ mv /media/user/drive/data/* /media/user/drive/technical1
$ ln -s /media/user/drive/technical1 /var/lib/mysql
$ ls -lah technical1
drwx------ 2 mysql mysql 4.0K Jan 16 13:58 technical1
**Questions**
- If I now execute the sql-statement SHOW DATABASES
, the database technical1
is no longer showing up. Why's that?
- Do the other steps look reasonable and correct, or can you see something else which looks odd?
Asked by Mikke Mus
(101 rep)
Jan 16, 2025, 05:11 PM
Last activity: Jan 16, 2025, 08:57 PM
Last activity: Jan 16, 2025, 08:57 PM