Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2019-09-22, 05:36:03

Author Topic: Can't connect to local MySQL  (Read 6421 times)

0 Members and 1 Guest are viewing this topic.

Offline alex_fear

  • Valuable Member
  • *
  • Posts: 54
  • Karma: +1/-0
    • View Profile
Can't connect to local MySQL
« on: 2016-02-10, 15:38:36 »
Stopped working MySQL database
what to do ?
Code: [Select]
[root@VM1 ~]# mysql restart
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Con  nection refused")
Code: [Select]
[root@VM1 ~]# sh /script/sysinfo
A. Control Panel:
   - Kloxo-MR: 7.0.0.b-2016021005
   - Web: hiawatha-10.0.0-f.6.mr.el6.x86_64
   - PHP: php54s-5.4.44-1.ius.el6 (cgi mode)
B. Plateform:
   - OS: CentOS release 6.7 (Final) x86_64
   - Hostname: VM1
C. Services:
   1. MySQL: MariaDB-server-10.0.20-1.el6.x86_64
   2. PHP:
      - Branch: php54-cli-5.4.45-1.ius.el6.x86_64
      - Multiple:
        * php52m-5.2.17-102.mr.el6
        * php53m-5.3.29-1.ius.el6
        * php54m-5.4.44-1.ius.el6
        * php55m-5.5.28-1.ius.el6
        * php56m-5.6.12-1.ius.el6
      - Used: php56m
   3. Httpd: httpd-2.2.31-1.mr.el6.x86_64
      - PHP Type: [unknown]
   4. Lighttpd: --uninstalled--
   5. Hiawatha: --unused--
   6. Nginx: --uninstalled--
   7. Cache: --uninstalled--
   8. Dns: bind-9.9.7-1.mr.el6.x86_64
   9. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
D. Memory:
                total       used       free     shared    buffers     cached
   Mem:          2815        889       1925         13         66        481
   -/+ buffers/cache:        341       2473
   Swap:         1999          0       1999
E. Disk Space:
   Filesystem      Size  Used Avail Use% Mounted on
   /dev/sda3        97G   21G   72G  23% /


*** Process Time: 00:00:00:11.11057 (dd:hh:mm:ss:xxxxxx) ***

* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
        (importance after Kloxo-MR update)


Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #1 on: 2016-02-10, 15:48:26 »
1. Try modified /etc/my.cnf.d/server.cnf to change 'skip-innodb' to '#skip-innodb' and then restart with 'sh /script/restart-mysql -y'
2. If still error, try 'sh /script/mysql-optimize --select=repair'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline alex_fear

  • Valuable Member
  • *
  • Posts: 54
  • Karma: +1/-0
    • View Profile
Re: Can't connect to local MySQL
« Reply #2 on: 2016-02-10, 15:54:30 »
vi /etc/my.cnf.d/server.cnf  ?? ?????????
Code: [Select]
[root@VM1 file]# vi /etc/my.cnf.d/server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]
default-storage-engine=innodb
#skip-innodb
performance_schema=on
#OpenVZ AIO bug fix
innodb_use_native_aio=0

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.0 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.0]
when performing restoration
Code: [Select]
[root@VM1 file]# sh /script/mysql-optimize --select=repair
Mysql Check/Repair/Optimize/Upgrade
- Repairing database
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused") when trying to connect
- MySQL Service restart
If you try to login kloxo gives an error message Alert: Login Unsuccessful

Issued when go to the website issue Error 500 - Internal Server Error

A generic error message, given when no more specific message is suitable
« Last Edit: 2016-02-10, 16:01:50 by alex_fear »

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #3 on: 2016-02-10, 16:39:55 »
Try 'sh /script/mysql-optimize --select=upgrade'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline alex_fear

  • Valuable Member
  • *
  • Posts: 54
  • Karma: +1/-0
    • View Profile
Re: Can't connect to local MySQL
« Reply #4 on: 2016-02-10, 16:57:54 »
server response
Code: [Select]
[root@VM1 ~]# sh /script/mysql-optimize --select=upgrade
Mysql Check/Repair/Optimize/Upgrade
- Upgrading database
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")
FATAL ERROR: Upgrade failed
- MySQL Service restart

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #5 on: 2016-02-10, 18:00:54 »
Inform here 'cat /var/lib/mysql/*.err' (enough latest 20 lines).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline alex_fear

  • Valuable Member
  • *
  • Posts: 54
  • Karma: +1/-0
    • View Profile
Re: Can't connect to local MySQL
« Reply #6 on: 2016-02-10, 18:24:23 »
Code: [Select]
150708 11:16:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150708 11:16:36 [Note] /usr/sbin/mysqld (mysqld 10.0.20-MariaDB) starting as process 25357 ...
150708 11:16:36 [Note] Plugin 'InnoDB' is disabled.
150708 11:16:36 [Note] Plugin 'FEEDBACK' is disabled.
150708 11:16:36 [Note] Server socket created on IP: '::'.
150708 11:16:36 [Note] Event Scheduler: Loaded 0 events
150708 11:16:36 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1286: Unknown storage en                                                                                                                   gine 'InnoDB'
150708 11:16:36 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.20-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
150708 11:18:24 mysqld_safe A mysqld process already exists
150708 11:23:28 mysqld_safe A mysqld process already exists
150708 11:23:39 [Warning] Host name 'reserve.cableplus.com.cn' could not be resolved: Name or service not known
150708 11:23:44 [Note] /usr/sbin/mysqld: Normal shutdown

150708 11:23:44 [Note] Event Scheduler: Purging the queue. 0 events
150708 11:23:44 [Note] /usr/sbin/mysqld: Shutdown complete

150708 11:23:44 mysqld_safe mysqld from pid file /var/lib/mysql/VM1.pid ended
150708 11:23:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150708 11:23:47 [Note] /usr/sbin/mysqld (mysqld 10.0.20-MariaDB) starting as process 2169 ...

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #7 on: 2016-02-10, 23:38:09 »
Try reboot.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline alex_fear

  • Valuable Member
  • *
  • Posts: 54
  • Karma: +1/-0
    • View Profile
Re: Can't connect to local MySQL
« Reply #8 on: 2016-02-11, 07:30:44 »
Rebooting does not helps. :'( :'( :'(
Code: [Select]
[root@VM1 ~]# service mysql status
 ERROR! MySQL is not running, but PID file exists
[root@VM1 ~]# service mysql start
Starting MySQL.. SUCCESS!
[root@VM1 ~]# service mysql status
 ERROR! Multiple MySQL running but PID file could not be found (5285 5280)
[root@VM1 ~]# service mysql restart
 ERROR! MySQL server PID file could not be found!
Starting MySQL. SUCCESS!

When you try to run mysql provides just such a mistake .
« Last Edit: 2016-02-11, 07:34:39 by alex_fear »

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #9 on: 2016-02-11, 07:35:23 »
What's you do or happen because this issue appear?.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline alex_fear

  • Valuable Member
  • *
  • Posts: 54
  • Karma: +1/-0
    • View Profile
Re: Can't connect to local MySQL
« Reply #10 on: 2016-02-11, 07:37:57 »
Nothing. After rebooting, stopped working database mysql database .

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #11 on: 2016-02-11, 07:43:42 »
Hmmm. Give me access to ssh and Kloxo-MR panel. I want to know what's happen.

Send your access via PM.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline alex_fear

  • Valuable Member
  • *
  • Posts: 54
  • Karma: +1/-0
    • View Profile
Re: Can't connect to local MySQL
« Reply #12 on: 2016-02-11, 07:54:49 »
ok.

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #13 on: 2016-02-11, 09:01:31 »
The problem is you try update MariaDB from 10.0.x to 10.1.x but possible make your database crash. Sadly, look like your mysql using innodb as storage-engine and need recover. So, I try downgrade to 10.0.x.

..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,709
  • Karma: +119/-10
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Can't connect to local MySQL
« Reply #14 on: 2016-02-11, 09:31:14 »
I am just backup your /var/lib/mysql to /var/lib/mysql.bck.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.087 seconds with 21 queries.

web stats analysis