0

I have fresh install ubuntu 16.04 side by side windows 10. In fresh install i have also installed mysql latest, and other things. I have smoothly worked on mysql for last 3-4 days. Mean while i have also open windows 10. But all on a sudden i can't login to mysql by "mysql -u root -p" which shows.

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

I have reinstall fresh ubuntu 16.04. 2-3 days working fine. after that same error.

I need to solution badly. All my works on ubuntu are stopped for approximately one month. I am not expert in linux.

mariadb.service - MariaDB 10.2.16 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: timeout) since Sun 2018-08-12 20:41:49 +06; 26min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 957 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemc
  Process: 954 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 946 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 1248
   Status: "Waiting for page cleaner"
   CGroup: /system.slice/mariadb.service
           └─1248 /usr/sbin/mysqld

Aug 13 02:38:47 munim-Inspiron-5548 systemd[1]: Starting MariaDB 10.2.16 database server...
Aug 13 02:38:48 munim-Inspiron-5548 mysqld[1248]: 2018-08-13  2:38:48 140571517081792 [Note] /usr/sbin/mysqld (mysqld 10.2.16-MariaDB-10.2.16+m
Aug 13 02:38:48 munim-Inspiron-5548 mysqld[1248]: 2018-08-13  2:38:48 140571517081792 [Warning] Could not increase number of max_open_files to
Aug 13 02:38:48 munim-Inspiron-5548 mysqld[1248]: 2018-08-13  2:38:48 140571517081792 [Warning] Changed limits: max_open_files: 16364  max_conn
Aug 12 20:40:18 munim-Inspiron-5548 systemd[1]: mariadb.service: Start operation timed out. Terminating.
Aug 12 20:41:49 munim-Inspiron-5548 systemd[1]: mariadb.service: State 'stop-final-sigterm' timed out. Skipping SIGKILL. Entering failed mode.
Aug 12 20:41:49 munim-Inspiron-5548 systemd[1]: Failed to start MariaDB 10.2.16 database server.
Aug 12 20:41:49 munim-Inspiron-5548 systemd[1]: mariadb.service: Unit entered failed state.
Aug 12 20:41:49 munim-Inspiron-5548 systemd[1]: mariadb.service: Failed with result 'timeout'.

Thanks

0

Your mariaDB service can not start and is not running. May be that the problem is the max file open limit.

Edit the service file and try to set these values

/usr/lib/systemd/system/mysqld.service

[Service]

LimitNOFILE=infinity

LimitMEMLOCK=infinity

May be that helps.

  • I have edited the service file from /etc/systemd/system/mariadb.service but still not working. I don't have any folder /usr/lib/systemd/system so no chance of having /usr/lib/systemd/system/mysqld.service file. – user3682961 Aug 12 '18 at 17:41
  • /lib/systemd/system/mariadb.service – Thomas Aichinger Aug 12 '18 at 17:42
  • i don't have system folder inside systemd. i have manually make system and keep mariadb.service inside lib/systemd/system. But still not working – user3682961 Aug 12 '18 at 17:45
  • remove the manually created file and search for mysqld.service with this command "find / | grep mysqld.service$" – Thomas Aichinger Aug 12 '18 at 17:50
  • /var/lib/systemd/deb-systemd-helper-enabled/mysqld.service and /etc/systemd/system/mysqld.service – user3682961 Aug 12 '18 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.