Does MemSQL support user passwords in a configuration file?


MySQL supports storing user passwords in a ~/.my.cnf file (

Does MemSQL support similar functionality and if so can you point me to the documentation. I searched but did not find anything.


Yes, this option works with MemSQL. This is an option in the MySQL client, so it works exactly as described in the MySQL client documentation you linked to.


I need some help then as it isn’t working for me.

I have created a /root/.my.cnf file with 0600 permissions and contents:

[root@ip-10-something ~]# cat .my.cnf

However, when as the root user I get:

[root@ip-10-something ~]# memsql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

If I supply my password with the -p flag it works as usual. Any advice on what I’m doing wrong?


Hmm, that worked for me, not sure why it isn’t working in your case. Perhaps try explicitly pointing to the .my.cnf file with the --defaults-file option.

[root@ip-10-something ~]# memsql -u root --defaults-file ~/.my.cnf
memsql-client: [ERROR] unknown option '--defaults-file'

Any ideas what could be going on or what else I need to check?

[root@ip-10-something ~]# memsql --version
/usr/lib/memsql-client/memsql-client  Ver 14.14 Distrib 5.7.17, for Linux (x86_64) using  EditLine wrapper


Ah, I see what the issue is. The memsql client package is a wrapper around the mysql client, and effectively uses the --no-defaults option. We are currently looking into this issue with specifying client configuration.

For now, I think the easiest solution is to install the mysql client and use that directly.


Oh, you can also run the memsql-client binary directly instead of memsql (memsql runs memsql-client with a few default parameters). Something like:

/usr/lib/memsql-client/memsql-client --plugin-dir="/usr/lib/memsql-client/plugin" --protocol=tcp --prompt="memsql> " -u root -h -P 3306

And you can create an alias for that of course.


I installed the mysql57 client package and all is working fine. Thanks Jack!