How to connect to MariaDB using SSH tunneling and port forwarding?

How to connect to MariaDB using SSH tunneling and port forwarding?

I have Ubuntu 18.04 which is connected through putty using a private key and running fresh install of MariaDB 10.1 and done the mysql secure installation. I have HeidiSQL installed on my windows PC which I want to connect to the MariaDB server via SSH tunneling and port forwarding. In the server terminal I did:

What to do if MariaDB is not connecting to localhost?

You can then run FLUSH PRIVILEGES to resume using the grant tables, followed by SET PASSWORD to change the password for an account. This creates a user with the ‘%’ wildcard host. However, you may still be failing to login from localhost. Some setups create anonymous users, including localhost. So the following records exist in the user table:

Which is easier to generate SSH keys MariaDB or SSL?

MariaDB [ (none)]> Generating SSH keys is a simpler process than the creation of SSL certificates, and the deployment is easier too. From my experience, there have also been fewer vulnerabilities with SSH than SSL. There is obviously some overhead in using an SSH tunnel, compared with an unencrypted connection.

Where do I find the socket file in MariaDB?

The socket file can be in a non-standard path. In this case, the socket option is probably written in the my.cnf file. Check that its value is identical in the [mysqld] and [client] sections; if not, the client will look for a socket in a wrong place.

How can I connect to a MariaDB instance on localhost?

Type ‘help;’ or ‘\\h’ for help. Type ‘\\c’ to clear the current input statement. This allows you to at least connect, and is a model for allowing other users to connect.

Why does MariaDB not accept a TCP connection?

If unsure where the Unix socket file is running, it’s possible to find this out, for example: Usually, the MariaDB server does not by default accept connections from a remote client or connecting with tcp and a hostname and has to be configured to permit these.