You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On this page it suggests the following command to test connection to your database from another system:
mysql -ubob -psecret –h192.168.0.2 --port=3306
When I tried this, replacing the user, password and host IP with my desired values, I get the following error:
ERROR 2002 (HY000): Can't connect to server on 'localhost' (115)
I thought to myself "that's strange, I'm asking it to connect to the host given in the command, I'm not asking it to connect to localhost". The system I am using has only the MariaDB client installed, it does not have MariaDB server installed, so there is nothing to connect to anyway.
After some time, I figured out the problem. In the command given on the wiki page, one of the hyphens is not a hyphen! The hyphen preceding the "h" is some other character that looks almost exactly like a hyphen, but isn't a hyphen. Deleting that character and re-typing a hyphen in its place fixed the problem, allowing me to connect to the MariaDB on the desired system.
Resolution:
change mysql -ubob -psecret –h192.168.0.2 --port=3306
to mysql -ubob -psecret -h192.168.0.2 --port=3306
Activity
PaulRB commentedon Sep 1, 2024
I think that character that should have been a hyphen is an "em dash"
https://www.sussex.ac.uk/informatics/punctuation/hyphenanddash/dash