Discover Centmin Mod today
Register Now

Install MariaDB mysql.sock No such file or directory error

Discussion in 'Install & Upgrades or Pre-Install Questions' started by abakisensoy, Jan 19, 2017.

  1. abakisensoy

    abakisensoy Member

    38
    2
    8
    Dec 2, 2016
    Ratings:
    +2
    Local Time:
    6:54 AM
    latest
    5.5
    • CentOS Version: CentOS 6.8 64bit
    • Centmin Mod Version Installed: Centmin Mod 1.2.3-eva2000.08
    • Nginx Version Installed: 1.11.8
    • PHP Version Installed: 5.6.29
    • MariaDB MySQL Version Installed:. 10.0.29
    • When was last time updated Centmin Mod code base ? : today i
    its on a xen vds with fresh install centos 6.8
    i installed centminmod with :
    yum -y update; curl -O https://centminmod.com/installer.sh && chmod 0700 installer.sh && bash installer.sh

    i get this error :
    >>mysql or mysqlstart
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")

    or :

    mysql -h localhost -u root -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")


    my centminmod_1.2.3-eva2000.08_170117-224554_install log : > https://gist.githubusercontent.com/...ae73eacf3dfdd51103f24142d476c56/gistfile1.txt
     
    Last edited: Jan 19, 2017
  2. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    6:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    strange you have permissions issues on /var/log directory and /var/log/mysqld.log
    Code (Text):
    Starting MySQL.170117 19:58:25 mysqld_safe Logging to '/var/log/mysqld.log'.
    170117 19:58:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld_safe_helper: Can't create/write to file '/var/log/mysqld.log' (Errcode: 13 "Permission denied")
     ERROR!
    service mysql stop
     ERROR! MySQL server PID file could not be found!
    service mysql start
    Starting MySQL.170117 19:58:26 mysqld_safe Logging to '/var/log/mysqld.log'.
    170117 19:58:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld_safe_helper: Can't create/write to file '/var/log/mysqld.log' (Errcode: 13 "Permission denied")
     ERROR!
    *************************************************
    [1;32;40m* MariaDB installed
    (B[m*************************************************
    service mysql stop
     ERROR! MySQL server PID file could not be found!

    What's output for these commands in SSH as root user
    Code (Text):
    ls -lah /var
    ls -lah /var/log
    cat /etc/my.cnf
    

    Might want to use CODE tags for code How to use forum BBCODE code tags :)

    did you install as sudo user or full root ? Centmin Mod doesn't support sudo user install has to be full root
     
  3. abakisensoy

    abakisensoy Member

    38
    2
    8
    Dec 2, 2016
    Ratings:
    +2
    Local Time:
    6:54 AM
    latest
    5.5
    Code:
    ls -lah /var
    total 72K
    drwxr-xr-x. 18 root root 4.0K Jan 17 20:08 .
    dr-xr-xr-x. 25 root root 4.0K Jan 17 20:17 ..
    drwxr-xr-x.  5 root root 4.0K Jan 17 19:43 cache
    drwxr-xr-x.  2 root root 4.0K Nov 22  2013 cvs
    drwxr-xr-x.  4 root root 4.0K Jan 17 20:08 db
    drwxr-xr-x.  3 root root 4.0K Jan 17 19:04 empty
    drwxr-xr-x.  2 root root 4.0K Mar 15  2011 ftp
    drwxr-xr-x.  2 root root 4.0K Sep 23  2011 games
    drwxr-xr-x. 25 root root 4.0K Jan 18 03:31 lib
    drwxr-xr-x.  2 root root 4.0K Sep 23  2011 local
    drwxrwxr-x.  5 root lock 4.0K Jan 17 19:04 lock
    drwxr-xr-x.  8 root root 4.0K Jan 18 10:43 log
    lrwxrwxrwx.  1 root root   10 Jan 17 19:03 mail -> spool/mail
    drwxr-xr-x.  2 root root 4.0K Sep 23  2011 nis
    drwxr-xr-x.  2 root root 4.0K Sep 23  2011 opt
    drwxr-xr-x.  2 root root 4.0K Sep 23  2011 preserve
    drwxr-xr-x. 19 root root 4.0K Jan 18 17:03 run
    drwxr-xr-x.  9 root root 4.0K Jan 17 19:44 spool
    lrwxrwxrwx.  1 root root    4 Jan 17 19:54 tmp -> /tmp
    drwxr-xr-x.  2 root root 4.0K Sep 23  2011 yp
    
    Code:
     ls -lah /var/log
    total 1.7M
    drwxr-xr-x.  8 root root 4.0K Jan 18 10:43 .
    drwxr-xr-x. 18 root root 4.0K Jan 17 20:08 ..
    -rw-------.  1 root root 2.4K Jan 17 19:05 anaconda.ifcfg.log
    -rw-------.  1 root root  19K Jan 17 19:05 anaconda.log
    -rw-------.  1 root root  34K Jan 17 19:05 anaconda.program.log
    -rw-------.  1 root root 105K Jan 17 19:05 anaconda.storage.log
    -rw-------.  1 root root  39K Jan 17 19:05 anaconda.syslog
    -rw-------.  1 root root 2.6K Jan 17 19:05 anaconda.yum.log
    drwxr-x---.  2 root root 4.0K Jan 17 19:05 audit
    -rw-r--r--.  1 root root 1.7K Jan 17 19:34 boot.log
    -rw-------.  1 root utmp 123K Jan 18 19:34 btmp
    drwxr-xr-x.  2 root root 4.0K May 10  2016 ConsoleKit
    -rw-------.  1 root root  22K Jan 18 19:40 cron
    -rw-r--r--.  1 root root  15K Jan 17 19:05 dmesg
    -rw-r--r--.  1 root root 389K Jan 17 19:36 dracut.log
    -rw-r--r--.  1 root root 144K Jan 18 19:44 lastlog
    -rw-------.  1 root root  16K Jan 18 19:44 lfd.log
    -rw-------.  1 root root  39K Jan 18 19:44 maillog
    -rw-------.  1 root root 607K Jan 18 19:44 messages
    drwxr-xr-x.  2 root root 4.0K Jan 17 19:57 nginx
    drwxr-xr-x.  2 ntp  ntp  4.0K May 31  2016 ntpstats
    drwxr-xr-x.  2 root root 4.0K Jan 17 20:04 php-fpm
    -rw-------.  1 root root 3.9K Jan 18 17:00 pureftpd.log
    drwxr-xr-x.  2 root root 4.0K Jan 18 00:00 sa
    -rw-------.  1 root root 103K Jan 18 19:44 secure
    -rw-------.  1 root root    0 Jan 17 19:03 spooler
    -rw-------.  1 root root    0 Jan 17 19:03 tallylog
    -rw-rw-r--.  1 root utmp 7.9K Jan 18 19:44 wtmp
    -rw-------.  1 root root  25K Jan 17 20:18 yum.log
    
    Code:
     cat /etc/my.cnf
    [mysqld]
    local-infile=0
    ignore-db-dir=lost+found
    #character-set-server=utf8
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    
    # bind-address=185.85.238.70
    # optimized my.cnf for MariaDB 5.5.x
    # by eva2000
    # vbtechsupport.com
    
    tmpdir=/home/mysqltmp
    
    innodb=ON
    #skip-federated
    #skip-pbxt
    #skip-pbxt_statistics
    #skip-archive
    #skip-name-resolve
    #old_passwords
    back_log = 75
    max_connections = 300
    key_buffer_size = 32M
    myisam_sort_buffer_size = 32M
    myisam_max_sort_file_size = 2048M
    join_buffer_size = 128K
    read_buffer_size = 128K
    sort_buffer_size = 256K
    table_definition_cache = 4096
    table_open_cache = 2048
    thread_cache_size = 64
    wait_timeout = 1800
    connect_timeout = 10
    tmp_table_size = 32M
    max_heap_table_size = 32M
    max_allowed_packet = 32M
    max_seeks_for_key = 1000
    group_concat_max_len = 1024
    max_length_for_sort_data = 1024
    net_buffer_length = 16384
    max_connect_errors = 100000
    concurrent_insert = 2
    read_rnd_buffer_size = 256K
    bulk_insert_buffer_size = 8M
    query_cache_limit = 512K
    query_cache_size = 16M
    query_cache_type = 1
    query_cache_min_res_unit = 2K
    query_prealloc_size = 262144
    query_alloc_block_size = 65536
    transaction_alloc_block_size = 8192
    transaction_prealloc_size = 4096
    default-storage-engine = InnoDB
    
    log_warnings=1
    slow_query_log=0
    long_query_time=1
    slow_query_log_file=/var/lib/mysql/slowq.log
    log-error=/var/log/mysqld.log
    
    # innodb settings
    innodb_large_prefix=1
    innodb_purge_threads=1
    innodb_file_format = Barracuda
    innodb_file_per_table = 1
    innodb_open_files = 1000
    innodb_data_file_path= ibdata1:10M:autoextend
    innodb_buffer_pool_size = 48M
    
    ## https://mariadb.com/kb/en/mariadb/xtradbinnodb-server-system-variables/#innodb_buffer_pool_instances
    #innodb_buffer_pool_instances=2
    
    innodb_log_files_in_group = 2
    innodb_log_file_size = 128M
    innodb_log_buffer_size = 8M
    innodb_flush_log_at_trx_commit = 2
    innodb_thread_concurrency = 0
    innodb_lock_wait_timeout=50
    innodb_flush_method = O_DIRECT
    innodb_support_xa=1
    
    # 200 * # DISKS
    innodb_io_capacity = 100
    innodb_read_io_threads = 2
    innodb_write_io_threads = 2
    
    # mariadb settings
    [mariadb]
    #thread-handling = pool-of-threads
    #thread-pool-size= 20
    #mysql --port=3307 --protocol=tcp
    #extra-port=3307
    #extra-max-connections=1
    
    userstat = 0
    key_cache_segments = 1
    aria_group_commit = none
    aria_group_commit_interval = 0
    aria_log_file_size = 32M
    aria_log_purge_type = immediate
    aria_pagecache_buffer_size = 8M
    aria_sort_buffer_size = 8M
    
    [mariadb-5.5]
    #ignore_db_dirs=
    query_cache_strip_comments=0
    
    innodb_read_ahead = linear
    innodb_adaptive_flushing_method = estimate
    innodb_flush_neighbor_pages = 1
    innodb_stats_update_need_lock = 0
    innodb_log_block_size = 512
    
    log_slow_filter =admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
    
    [mysqld_safe]
    socket=/var/lib/mysql/mysql.sock
    log-error=/var/log/mysqld.log
    #nice = -5
    open-files-limit = 8192
    
    [mysqldump]
    quick
    max_allowed_packet = 32M
    
    [myisamchk]
    tmpdir=/home/mysqltmp
    key_buffer = 32M
    sort_buffer = 16M
    read_buffer = 16M
    write_buffer = 16M
    
    [mysqlhotcopy]
    interactive-timeout
    
    [mariadb-10.0]
    # 2 variables needed to switch from XtraDB to InnoDB plugins
    #plugin-load=ha_innodb
    #ignore_builtin_innodb
    
    ## MariaDB 10 only save and restore buffer pool pages
    ## warm up InnoDB buffer pool on server restarts
    innodb_buffer_pool_dump_at_shutdown=1
    innodb_buffer_pool_load_at_startup=1
    innodb_buffer_pool_populate=0
    ## Disabled settings
    performance_schema=OFF
    innodb_stats_on_metadata=OFF
    innodb_sort_buffer_size=2M
    innodb_online_alter_log_max_size=128M
    query_cache_strip_comments=0
    log_slow_filter =admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    6:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    could be selinux restrictions in place. It's why install guide has selinux must be disabled first Centmin Mod LEMP Stack Install Nginx on CentOS

    what is output for command
    Code (Text):
    sestatus

    example
    Code (Text):
    sestatus        
    SELinux status:                 disabled

    If selinux is enabled disable via command
    Code (Text):
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && setenforce 0
    

    and reboot server
    then try restart mariadb mysql server
    Code (Text):
    mysqlrestart
    


    selinux is very rarely enabled by default on most servers unless you enabled it ?

    or in /etc/my.cnf comment out with hash
    Code (Text):
    #log-error=/var/log/mysqld.log

    then try restart mariadb mysql server
    Code (Text):
    mysqlrestart
    
     
  5. abakisensoy

    abakisensoy Member

    38
    2
    8
    Dec 2, 2016
    Ratings:
    +2
    Local Time:
    6:54 AM
    latest
    5.5
    it is strange here :
    SELINUX=disabled
    Code:
     cat /etc/sysconfig/selinux
    
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of these two values:
    #     targeted - Targeted processes are protected,
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    
    but :
    Code:
    sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /selinux
    Current mode:                   permissive
    Mode from config file:          disabled
    Policy version:                 24
    Policy from config file:        targeted
    
    SELinux status: enabled

    i run :
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && setenforce 0
    still :
    sestatus :
    SELinux status: enabled

    centmin :

    Code:
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 14
    --------------------------------------------------------
    
    ---------------------------------------------
    checking /etc/selinux/config
    SELinux already disabled
    SELINUX=disabled
    ---------------------------------------------
    
     
  6. abakisensoy

    abakisensoy Member

    38
    2
    8
    Dec 2, 2016
    Ratings:
    +2
    Local Time:
    6:54 AM
    latest
    5.5
    i reboot the server

    Code:
    >> sestatus
    SELinux status:                 disabled
    
    but still
    >>mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    
    >>mysqlrestart
     ERROR! MySQL server PID file could not be found!
    Starting MySQL.170118 20:06:32 mysqld_safe Logging to '/var/log/mysqld.log'.
    170118 20:06:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld_safe_helper: Can't create/write to file '/var/log/mysqld.log' (Errcode: 13 "Permission denied")
     ERROR!
     
  7. Afaq

    Afaq Member

    61
    1
    8
    Aug 5, 2015
    Ratings:
    +2
    Local Time:
    1:54 AM
    I am having this exact same issue. I checked and my SELinux is also disabled. But still the MySql wont start.

    I am running CentOS 6.8 x64 on DigitalOcean. I have tried installing Centmin several times but same issue is coming up.
     
  8. abakisensoy

    abakisensoy Member

    38
    2
    8
    Dec 2, 2016
    Ratings:
    +2
    Local Time:
    6:54 AM
    latest
    5.5
    Code:
    CentOS Version:
    Centmin Mod Version Installed:
    Nginx Version Installed:
    PHP Version Installed: 
    MariaDB MySQL Version Installed:. 
    When was last time updated Centmin Mod code base ? : 

    can you fill those above code part ? centos version etc. and please post your centminmod installiation log file too.
     
    • Like Like x 1
  9. Afaq

    Afaq Member

    61
    1
    8
    Aug 5, 2015
    Ratings:
    +2
    Local Time:
    1:54 AM
    CentOS Version: 7.3.1611
    Centmin Mod Version Installed: Centmin Mod 1.2.3-eva2000.08
    When was last time updated Centmin Mod code base ? Today.

    Now I am trying the latest Centmin beta to see if the issue is there as well.
     
    • Informative Informative x 1
  10. abakisensoy

    abakisensoy Member

    38
    2
    8
    Dec 2, 2016
    Ratings:
    +2
    Local Time:
    6:54 AM
    latest
    5.5
    i am plannig to format my vds and install again. let us know if you find solution or fix.
     
  11. reallove0810

    reallove0810 New Member

    22
    10
    3
    Jan 3, 2015
    Ratings:
    +11
    Local Time:
    9:54 PM
    1.7.9
    5.5.41
    I'm getting the same problem at VULTR (CentOS 6.8 64bit) :mad::mad::mad:
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    6:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Jan 19, 2017
  13. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    6:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    for temp work around disable custom mysql error log path
    in /etc/my.cnf comment out with hash
    Code (Text):
    #log-error=/var/log/mysqld.log

    then try restart mariadb mysql server
    Code (Text):
    mysqlrestart
    
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    6:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    when you restart mysql what is exact error message you get ?
     
  15. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    6:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    also try these 2 commands and reboot server and see
    Code (Text):
        sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux && setenforce 0
        sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/sysconfig/selinux && setenforce 0
    

    these updated commands have been committed to both 123.08stable and 123.09beta01 latest code at time of writing this
     
    Last edited: Jan 19, 2017
  16. reallove0810

    reallove0810 New Member

    22
    10
    3
    Jan 3, 2015
    Ratings:
    +11
    Local Time:
    9:54 PM
    1.7.9
    5.5.41
    Nothing change.
    Code (Text):
    [root@sv ~]# mysqlrestart
     ERROR! MySQL server PID file could not be found!
    Starting MySQL.170119 08:05:11 mysqld_safe Logging to '/var/log/mysqld.log'.
    170119 08:05:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld_safe_helper: Can't create/write to file '/var/log/mysqld.log' (Errcode: 13 "Permission denied")
    
     
  17. reallove0810

    reallove0810 New Member

    22
    10
    3
    Jan 3, 2015
    Ratings:
    +11
    Local Time:
    9:54 PM
    1.7.9
    5.5.41
    Server says
    Code (Text):
    [root@sv ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux && setenforce 0
    sed: can't read /etc/sysconfig/selinux: No such file or directory
     
  18. reallove0810

    reallove0810 New Member

    22
    10
    3
    Jan 3, 2015
    Ratings:
    +11
    Local Time:
    9:54 PM
    1.7.9
    5.5.41
    in the log file, you can also see
    Code:
    cp: cannot create regular file `/usr/local/nginx/html/vhost_status.html': No such file or directory
    or
    Code:
    grep: /usr/local/nginx/conf/conf.d/virtual.conf: No such file or directory
    and when I try to restart nginx or fpm
    Code (Text):
    [root@sv ~]# service nginx restart
    /etc/init.d/nginx: line 71: /usr/local/sbin/nginx: No such file or directory


    Code (Text):
    [root@sv ~]# fpmrestart
    Gracefully shutting down php-fpm kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
    ................................... failed. Use force-exit
    Starting php-fpm /etc/init.d/php-fpm: line 78: /usr/local/sbin/php-fpm: No such file or directory
     failed


    I think the problem is not from MariaDB
     
  19. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    6:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    what's output for
    Code (Text):
    rpm -qa | grep selinux
    
     
  20. reallove0810

    reallove0810 New Member

    22
    10
    3
    Jan 3, 2015
    Ratings:
    +11
    Local Time:
    9:54 PM
    1.7.9
    5.5.41
    Code (Text):
    [root@sv ~]# rpm -qa | grep selinux
    libselinux-2.0.94-7.el6.x86_64
    libselinux-devel-2.0.94-7.el6.x86_64
    libselinux-utils-2.0.94-7.el6.x86_64