ankane / setup-mariadb

The missing action for MariaDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Socket connection on Linux supported?

krlmlr opened this issue · comments

https://github.com/r-dbi/RMariaDB/pull/185/checks?check_run_id=1484154324#step:13:160

On Linux I'm seeing with RMariaDB:

Error: Failed to connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I wonder why mysql commands work, wouldn't they also use the socket by default? Is the socket in a different location?

Per https://mariadb.com/kb/en/missing-mysqldsock-file/#comment_165, do we need

ln -s /tmp/mysql.sock /var/run/mysqld/mysqld.sock

?

No, the path exists.

Hmm, the installation should be pretty standard. It looks like the socket is at /run/mysqld/mysqld.sock.

mysql -e "SHOW VARIABLES LIKE '%socket%'"
Variable_name Value
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances -1
socket  /run/mysqld/mysqld.sock

https://github.com/ankane/setup-mariadb/runs/1484303215?check_suite_focus=true

Just updated the tests to print the socket location for each platform and version: https://github.com/ankane/setup-mariadb/actions/runs/395356603

One more thing: the workers on Linux already have MySQL installed, could that be a source for conflicts?

Connection worked in RMariaDB when I used the builtin MySQL and enabled the service. I'm still confused why things seem to work when running mysql -e --protocol socket .

MySQL is automatically removed when MariaDB is installed and vice versa.

It looks like your test suite is reinstalling MySQL in the "Install system dependencies" step.

2020-12-02T03:56:35.4946065Z The following packages will be REMOVED:
2020-12-02T03:56:35.4948237Z   mariadb-client-10.5 mariadb-client-core-10.5 mariadb-server-10.5
2020-12-02T03:56:35.4949697Z   mariadb-server-core-10.5
2020-12-02T03:56:35.4951332Z The following NEW packages will be installed:
2020-12-02T03:56:35.4952666Z   mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7
2020-12-02T03:56:35.4953859Z   mysql-server-core-5.7

Good catch! Thanks a lot.