Cannot login into MariaDB

You are viewing an old version of this question. View the current version here.

Hello all! I'm using MacOS Sonoma 14.5 and trying to login in mariadb via terminal. However, when I execute

```sh mariadb -uroot -password ```

It is returning

```error ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2) ```

I searched online and the solution to this would be to generate a `mysql.sock` file by executing

```sh brew services start mariadb

  1. OR brew services restart mariadb ```

However, I tried it, as you can see below:

```sh $ brew services restart mariadb Stopping `mariadb`... (might take a while)

> Successfully stopped `mariadb` (label: homebrew.mxcl.mariadb)

> Successfully started `mariadb` (label: homebrew.mxcl.mariadb)

```

Still, not any `mysql.sock` file is generated inside the `/tmp` folder and I can't login in the `mariadb` database.

```sh victorcosta@Victors-MacBook-Pro:/tmp $ cd /tmp victorcosta@Victors-MacBook-Pro:/tmp $ ls com.apple.launchd.6mj6GfdTiF powerlog ```

So, how can I connect to `mariadb` using `mariadb -uroot -password`?

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.