0

Have any existing MySQL 8.0 server installation on a Ubuntu 22.04 machine. Existing works without issue, but looking to import a very large DB but doing so in its current data directory will max out my available HD space.

As such, I'd like to import the new large DB to a secondary location (on an external HD) and ideally use existing MySQL server installation seamlessly (ie, could use MySQL 'USE db_name;' command to move back and forth between DBs and would simply redirect to secondary location for new large DB) (possibly some kind of symbolic link?).

Any way to accomplish this?

1

1 Answer 1

1

You want to add a new database to an existing mysql instance but using a different path?

Are you using innodb? Are you using innodb_file_per_table? If not (i.e. the default on most installations) then the simplest way to achieve this is to rewrite your import file to specify the DATA DIRECTORY.

Alternatively you could import it to myISAM/Aria - each database resides in its own directory and you can migrate the directory using symlinks - create the database, stop mysql, move the directory and create a symlink from the original location, then start mysql.

3
  • Have dedicated .ibd files, so presume I do. Any reason to try the mysam route over the link in the comment above (look straightforward-ish)?
    – Chris
    Commented Feb 13 at 17:55
  • Nope. Whatever works for you.
    – symcbean
    Commented Feb 13 at 21:43
  • MyISAM/Aria database engines are from the 90s and 2000s. They are not ACID compliant, they don't guarantee data consistency and data durability, and don't support transactions. They are not recommended for general database workloads. Don't use them unless you know exactly what you are doing.
    – AlexD
    Commented Feb 14 at 6:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .