CREATE TABLE requires data_dir to be set in the config file

I get this error in the the terminal:

# mysql -P9306 -h0
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 3.5.4 13f8d08d@201211 release git branch HEAD (no branch)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE TABLE testrt(title text, content text, counter int);
ERROR 1064 (42000): CREATE TABLE requires data_dir to be set in the config file

despite the fact that in /etc/manticoresearch/manticore.conf I have

searchd {
    listen = 9312
    listen = 9306:mysql41
    seamless_rotate = 1
    preopen_indexes = 1
    unlink_old = 1
    log = /var/log/manticore/searchd.log
    query_log = /var/log/manticore/query.log
    pid_file = /var/run/
    binlog_path = /var/lib/manticore/data
    data_dir = /var/manticore

index testrt {
    type = rt
    rt_field = title
    rt_field = content
    rt_attr_uint = counter

And I created created the path like this:

# ls -al /var/manticore
total 8
drwxrwxrwx  2 manticore manticore 4096 Mar 10 08:47 .
drwxr-xr-x 16 root      root      4096 Mar 10 08:47 ..

I tried many variations of the config but none worked.
Appreciate a working example for this because the docs is just confusing about this.

Have you restarted searchd since adding data_dir ?

That seems the most likely issue.

1 Like

Actually such config should not run at all.

You either define indexes in the config, either provide data_dir in daemon’s section, never both.

Daemon should report fatal error “‘data_dir’ cannot be mixed with index declarations in ‘/path/to/config.conf’” if both present.