I have an existing MySQL 8 installation on a Ubuntu 22.04 system that relies on the standard /var/lib/mysql datadir.
I'm trying to load a dumped .sql file to a new database, but it's too big to be loaded to the current datadir; I'm trying to use a symbolic link to house the data on a larger external drive instead.
I've turned on symlinks (which are disabled by default):
mysql> show variables like '%symlink%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_symlink | YES |
+---------------+-------+
1 row in set (0.01 sec)
I've created the database:
mysql> create database symop;
Query OK, 1 row affected (0.02 sec)
I've established the symlink:
chris@chris-X1C6:/media/chris/T7$ sudo ln -s /media/chris/F/symop /var/lib/mysql/symop
And started the load:
chris@chris-X1C6:/media/chris/T7$ mysql -h 127.0.0.1 -u root -p -D symop < op_prices.sql
but the size of the table within /var/lib/mysql/symop is the only one growing in size.
What am I missing?
Edit:
chris@chris-X1C6:/media/chris/F/symop$ sudo ls -lad /media/chris/F/symop /var/lib/mysql/symop
[sudo] password for chris:
drwxrwxrwx 1 root root 0 Feb 13 22:27 /media/chris/F/symop
drwxr-x--- 2 mysql mysql 4096 Feb 13 23:18 /var/lib/mysql/symop