0

For a particular project I wanted to have Mint (Sonja) appliance with all MariaDB and only MariaDB doing MySQL's work, without a hint of MySQL so I know I'm working with MariaDB.

The appliance is one where I've installed multiple open source projects that power their own website (Alfresco, Request Tracker, SuiteCRM, etc.), and all of them seem to have worked either with MariaDB, or just used Postgres without interesting difficulty, and up until I tried to create a new MariaDB database to add a clone of a specific Wordpress site, MariaDB worked predictably well with no headaches on the same system. Until now, where I can't seem to find a pulse.

The MariaDB troubleshooting page confirmed what I'd found in my investigations (in particular, a ps wwaux | grep mysql only turned up the grep process). The basic problem as I'd encountered it was when I tried to log in to create a database:

monk@toolchest ~ $ mysql -uroot -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
'/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

I've never gotten involved with MySQL's or MariaDB's /etc configuration files, but I looked briefly. They appeared sane to my uneducated eye.

Neither an aptitude reinstall mariadb-server nor a service mysql start produce any changes so far as I could tell.

For service mysql start, I got:

# service mysql start
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

The details for systemctl status mysql.service were:

● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2017-07-14 18:16:38 EEST; 1min 11s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 5011 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Jul 14 18:16:38 toolchest /etc/init.d/mysql[5479]: 0 processes alive and '/usr/bin/mysql
Jul 14 18:16:38 toolchest /etc/init.d/mysql[5479]: [61B blob data]
Jul 14 18:16:38 toolchest /etc/init.d/mysql[5479]: error: 'Can't connect to local MySQL 
Jul 14 18:16:38 toolchest /etc/init.d/mysql[5479]: Check that mysqld is running and that
Jul 14 18:16:38 toolchest /etc/init.d/mysql[5479]: 
Jul 14 18:16:38 toolchest mysql[5011]:    ...fail!
Jul 14 18:16:38 toolchest systemd[1]: mysql.service: Control process exited, code=exited
Jul 14 18:16:38 toolchest systemd[1]: Failed to start LSB: Start and stop the mysql data
Jul 14 18:16:38 toolchest systemd[1]: mysql.service: Unit entered failed state.
Jul 14 18:16:38 toolchest systemd[1]: mysql.service: Failed with result 'exit-code'.

The recent (i.e. non-cronned) content of journalctl -xe ran:

-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has failed.
-- 
-- The result is failed.
Jul 14 18:16:38 toolchest systemd[1]: mysql.service: Unit entered failed state.
Jul 14 18:16:38 toolchest systemd[1]: mysql.service: Failed with result 'exit-code'.

/etc/mysql/mariadb.cnf and /etc/mysql/my.cnf both read (comments stripped):

[client-server]
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

/etc/mysql/my.cnf.fallback dropps the latter !includedir. Commenting out the latter /etc/mysql/my.cnf to match the fallback file produced identical results.

I can edit my question to include more of /etc/mysql/*, but I wanted to ask. Error messages similar to the ERROR 2002 are to be found in questions like Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38), but these appear to be MySQL rather than MariaDB, and I suspect this may be a MariaDB-specific fluke.

Christos Hayward
  • 5,777
  • 17
  • 58
  • 113
  • have you tried the approch in the article you have posted? I mean mariadb is a fork of mysql so many components have the same core. – BlackFlag Jul 15 '17 at 05:56
  • @BlackFlag Good thought! But as far as I can tell, this is not due to conflicting paths for the socket. In https://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38, at least the top response addresses conflicting information about where the socket file is to be looked for. On my machine, everything I could find was on the same page about the socket path, `/var/run/mysqld/mysql.sock`. This is a different path, but things were entirely consistent. Adding group execute permissions changed nothing. mysql.sock is nonexistant even to root. – Christos Hayward Jul 17 '17 at 14:10
  • What do you mean if you say "mysql.sock" is nonexistant even to root? – BlackFlag Jul 18 '17 at 08:29
  • @BlackFlag I mean that nothing I tried found anything at that path: no named socket, no file, no directory. For example, `ls /var/run/mysqld/mysql.sock` gets `ls: cannot access /var/run/mysqld/mysql.sock: No such file or directory`. – Christos Hayward Jul 19 '17 at 09:40
  • well if even root cannot access the file then something seems to be wrong within the filesystem?? have you tried to copy an identical file to this location? Can you run fsck? – BlackFlag Jul 20 '17 at 11:18
  • If this is something wrong with the filesystem, then this is the one and only red flag I've seen that the filesystem is corrupt. – Christos Hayward Jul 21 '17 at 12:16
  • Did you check the fs? – BlackFlag Jul 24 '17 at 06:29

0 Answers0