MemSQL 6.8.6 Installation Failure -> Failed to Deploy Master Aggregator -> Failed to connect to MemSQL: Could not establish connection: Error 1045: Access denied for user 'root'@'localhost'

Hey team,

I’m unable to get MemSQL 6.8.6 properly installed on my Ubuntu 18.04.2 LTS machine due to the following errors:

Failed to deploy master aggregator
Failed to connect to MemSQL: Could not establish connection: Error 1045: Access denied for user ‘root’@‘localhost’


I have searched across this forum, as well as on StackOverflow, and have yet to find a solution. Below are the installation steps I'm following, directly from the MemSQL website:


I am running the following command under the ‘user’ account, which has sudo privileges. Is this where I’m wrong, and should run this under ‘root’ instead?

memsql-deploy cluster-in-a-box --license <actual_license_removed>


Results:

The target user user on host 127.0.0.1 does not have the privileges to perform this action.
Please enter your password to proceed with sudo. (For details, see https://docs.memsql.com/toolbox-redir/sudo-prompt).
sudo password for user@127.0.0.1:


At this prompt I type my password, which then results in the below:

memsql-deploy will perform the following actions:
· Install memsql-server 6.8.6 locally
· Deploy a master aggregator on port 3306
· Deploy a leaf node on port 3307

Would you like to continue? [y/N]: y
✓ Downloaded memsql-server 6.8.6
Installing MemSQL locally…
✓ MemSQL 6.8.6 already installed
✘ Failed to deploy master aggregator
Starting rollback
✓ Installed MemSQL 6.8.6
✓ Rollback succeeded
error running memsqlctl: error running command: "/usr/bin/sudo" "-S" "-k" "--" "/bin/sh" "-c" "'printf' '263f7700-4c66-47ac-bc3b-45ff69582347' && 'exec' 'memsqlctl' '--json' '--yes' 'create-node' '--port' '3306' '--secure-password' '<actual_password_removed>' '--timeout' '60s'": exit status 1
stderr: [sudo] password for user: Latest errors from MemSQL tracelog:
54 2019-08-06 17:37:09.897 INFO: Log opened
: Failed to connect to MemSQL: Could not establish connection: Error 1045: Access denied for user ‘root’@‘localhost’ (using password: NO)

Hi ymonye,

Are ports 3306 or 3307 currently in use by other processes? If they are, this could be causing the error you are seeing.

You can also run memsql-deploy with the -v flag to get more verbose output, which may help to pinpoint where the error is.

Scott

Hey sschwarz, nothing is using ports 3306 or 3307. Seems I have a permissions issue on this machine, even though it’s a baremetal Ubuntu server I own with full admin rights.

I’m running the above commands on my ‘user’ account instead of root.

With the -v flag:

$ memsql-deploy cluster-in-a-box -v --license <actual_license_removed>
2019/08/14 22:15:40 main.go:39 Running command /usr/bin/which rpm
2019/08/14 22:15:40 main.go:39 Command /usr/bin/which rpm failed with exit code 1 in 819.218µs
2019/08/14 22:15:40 main.go:39 Running command /usr/bin/which dpkg
2019/08/14 22:15:40 main.go:39 Command /usr/bin/which dpkg took 743.265µs
memsql-deploy will perform the following actions:
· Install memsql-server 6.8.7 locally
· Deploy a master aggregator on port 3306
· Deploy a leaf node on port 3307

Would you like to continue? [y/N]: y
✓ Downloaded memsql-server 6.8.7
2019/08/14 22:15:49 main.go:39 Running command /usr/bin/id -u -n
2019/08/14 22:15:49 main.go:39 Command /usr/bin/id -u -n took 1.147378ms
2019/08/14 22:15:49 main.go:39 Running command /usr/bin/which sudo
2019/08/14 22:15:49 main.go:39 Command /usr/bin/which sudo took 730.779µs
2019/08/14 22:15:49 main.go:39 Running command /usr/bin/sudo -n -k -l
2019/08/14 22:15:49 main.go:39 Command /usr/bin/sudo -n -k -l failed with exit code 1 in 3.270706ms
The target user user on host 127.0.0.1 does not have the privileges to perform this action.
Please enter your password to proceed with sudo. (For details, see https://docs.memsql.com/toolbox-redir/sudo-prompt).
sudo password for user@127.0.0.1:
2019/08/14 22:16:01 main.go:39 Running command /usr/bin/timeout --foreground 5 sudo -S -k -v
2019/08/14 22:16:01 main.go:39 Command /usr/bin/timeout --foreground 5 sudo -S -k -v took 10.335775ms
Installing MemSQL locally…
⠋ Checking system for existing MemSQL packages 2019/08/14 22:16:01 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'which' 'memsqlctl'
2019/08/14 22:16:01 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'which' 'memsqlctl' took 11.035279ms
2019/08/14 22:16:01 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'readlink' '--canonicalize' '--no-newline' '/usr/bin/memsqlctl'
2019/08/14 22:16:01 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'readlink' '--canonicalize' '--no-newline' '/usr/bin/memsqlctl' took 10.929191ms
2019/08/14 22:16:01 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--search' '/opt/memsql-server-6.8.7-d632c4ab35/memsqlctl'
⠙ Checking system for existing MemSQL packages 2019/08/14 22:16:01 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--search' '/opt/memsql-server-6.8.7-d632c4ab35/memsqlctl' took 105.553894ms
2019/08/14 22:16:01 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--show' '--showformat' '${Package} ${Version} ${db:Status-Abbrev}\n'
2019/08/14 22:16:01 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--show' '--showformat' '${Package} ${Version} ${db:Status-Abbrev}\n' took 42.217161ms
✓ MemSQL 6.8.7 already installed
2019/08/14 22:16:01 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'list-nodes'
2019/08/14 22:16:01 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'list-nodes' took 14.783277ms
2019/08/14 22:16:01 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'upsert-secure-key'
⠹ Deploying master aggregator 2019/08/14 22:16:01 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'upsert-secure-key' took 14.842888ms
2019/08/14 22:16:01 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'create-node' '--port' '3306' '--secure-password' '<actual_password_removed>' '--timeout' '60s'
⠧ Deploying master aggregator 2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'create-node' '--port' '3306' '--secure-password' '<actual_password_removed>' '--timeout' '60s' failed with exit code 1 in 524.76618ms
✘ Failed to deploy master aggregator
Starting rollback
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'list-nodes'
2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'list-nodes' took 16.677743ms
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'stop-node' '--memsql-id' '5B944B424B1A49B55642FEF8ACDF5753B864F245'
2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'stop-node' '--memsql-id' '5B944B424B1A49B55642FEF8ACDF5753B864F245' took 18.179931ms
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'delete-node' '--memsql-id' '5B944B424B1A49B55642FEF8ACDF5753B864F245'
2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'delete-node' '--memsql-id' '5B944B424B1A49B55642FEF8ACDF5753B864F245' took 20.891299ms
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'which' 'memsqlctl'
2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'which' 'memsqlctl' took 11.013213ms
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'readlink' '--canonicalize' '--no-newline' '/usr/bin/memsqlctl'
⠇ Uninstalling MemSQL 6.8.7 2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'readlink' '--canonicalize' '--no-newline' '/usr/bin/memsqlctl' took 10.97076ms
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--search' '/opt/memsql-server-6.8.7-d632c4ab35/memsqlctl'
⠏ Uninstalling MemSQL 6.8.7 2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--search' '/opt/memsql-server-6.8.7-d632c4ab35/memsqlctl' took 104.915686ms
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--show' '--showformat' '${Package} ${Version} ${db:Status-Abbrev}\n'
2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg-query' '--show' '--showformat' '${Package} ${Version} ${db:Status-Abbrev}\n' took 41.834371ms
2019/08/14 22:16:02 main.go:39 Running command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg' '--remove' 'memsql-server6.8.7-d632c4ab35'
⠙ Uninstalling MemSQL 6.8.7 2019/08/14 22:16:02 main.go:39 Command /usr/bin/sudo -S -k -- /bin/sh -c 'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'dpkg' '--remove' 'memsql-server6.8.7-d632c4ab35' took 246.096707ms
✓ Installed MemSQL 6.8.7
✓ Rollback succeeded
error running memsqlctl: error running command: "/usr/bin/sudo" "-S" "-k" "--" "/bin/sh" "-c" "'printf' 'd30232d0-0b8e-4328-952a-0eb18aef6203' && 'exec' 'memsqlctl' '--json' '--yes' 'create-node' '--port' '3306' '--secure-password' '<actual_password_removed>' '--timeout' '60s'": exit status 1
stderr: [sudo] password for user: Latest errors from MemSQL tracelog:
53 2019-08-14 22:16:02.184 INFO: Log opened
: Failed to connect to MemSQL: Could not establish connection: Error 1045: Access denied for user ‘root’@‘localhost’ (using password: NO)

Hey all, I got this working. Apparently I had mysqld also using port 3306.

Consider this closed