Mysql create a general tablespace in a specific directory

29 Views Asked by At

I am trying to create a tablespace in a specific directory /home/tareq178/data/ in my Linux Ubuntu 22.04.3 VM. I am using the following command

CREATE TABLESPACE newspace2 ADD DATAFILE "/home/tareq178/data/newspace2.ibd" engine=InnoDB;

But it's giving me ar error

ERROR 3121 (HY000): The directory does not exist or is incorrect.

The path already exists and I have given the directory ownership to mysql.

issue

I have also specified innodb_directories in the "/etc/mysql/my.cnf" file

innodb_directories

And if I type

show variables like "innodb_directories"

I can see the directory has been added correctly. innodb_directories2

Still I get the same error. My Mysql version is mysql

Ver 8.0.36-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

How can I create a tablespace in a specific directory?

0

There are 0 best solutions below