Storage dump with another path for mysql

when I try to run ./bin/storage dump , I got the following error
mysqldump: Got error: 2002: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) when trying to connect

I think this is bcz I am using a self-compiled mysql version, which was located at /srv/mysql. However, seems I cannot find any options that specify the mysql database path.

Is there anything I can do here? Thanks

hmm. I once had a similar issue where the user did not have permission to login via socket, only via tcp (mysql allows for these things).
For that case, https://secure.phabricator.com/D16317 forced the command to use TCP in one use-case, but not in the dump workflow.

You should be able to run bin/storage --trace dump, which will show you exactly the mysqldump command it’s executing; Then you can try testing some options:

  • if you didn’t specify a port in config, try adding the default one (3306?), which will add --port xxx to the dump command.
  • If it ignores the --port instruction, try adding --protocol=TCP and see if that works.
1 Like

Thanks @avivey, I can dump data now.