MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: alex_fear on 2016-02-10, 15:38:36

Title: Can't connect to local MySQL
Post by: alex_fear 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)

Title: Re: Can't connect to local MySQL
Post by: MRatWork 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'
Title: Re: Can't connect to local MySQL
Post by: alex_fear 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
Title: Re: Can't connect to local MySQL
Post by: MRatWork on 2016-02-10, 16:39:55
Try 'sh /script/mysql-optimize --select=upgrade'
Title: Re: Can't connect to local MySQL
Post by: alex_fear 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
Title: Re: Can't connect to local MySQL
Post by: MRatWork on 2016-02-10, 18:00:54
Inform here 'cat /var/lib/mysql/*.err' (enough latest 20 lines).
Title: Re: Can't connect to local MySQL
Post by: alex_fear 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 ...
Title: Re: Can't connect to local MySQL
Post by: MRatWork on 2016-02-10, 23:38:09
Try reboot.
Title: Re: Can't connect to local MySQL
Post by: alex_fear 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 .
Title: Re: Can't connect to local MySQL
Post by: MRatWork on 2016-02-11, 07:35:23
What's you do or happen because this issue appear?.
Title: Re: Can't connect to local MySQL
Post by: alex_fear on 2016-02-11, 07:37:57
Nothing. After rebooting, stopped working database mysql database .
Title: Re: Can't connect to local MySQL
Post by: MRatWork 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.
Title: Re: Can't connect to local MySQL
Post by: alex_fear on 2016-02-11, 07:54:49
ok.
Title: Re: Can't connect to local MySQL
Post by: MRatWork 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.

Title: Re: Can't connect to local MySQL
Post by: MRatWork on 2016-02-11, 09:31:14
I am just backup your /var/lib/mysql to /var/lib/mysql.bck.
Title: Re: Can't connect to local MySQL
Post by: MRatWork on 2016-02-11, 09:43:49
Also add 'innodb_force_recovery=4' in /etc/my.cnf.d/server.cnf. And then need backup, delete database, disable recovery (need restart) and then restore process.
Title: Re: Can't connect to local MySQL
Post by: alex_fear on 2016-02-11, 18:35:18
I can not remove the base from the kloxo. The base is removed physically and Kloxo panel remains.
When you create a database database physically soda and Kloxo panel is not displayed .
Title: Re: Can't connect to local MySQL
Post by: Chicken2nd on 2019-09-07, 04:34:36
Fix services
- Fix dns services
- Fix webcache services
- Fix ssl services
- Fix php services
- Fix web services
- Fix mail-all services
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")
Enter password:
When i cleanup