Category Archives: Mysql

Cloudflare with Engintron

We had a issue where domain which is using cloudflare and server had engintron those domains were not working correctly

Engintron does support Cloudflare . There are few custom rules which needs to be setup from

WHM > Plugin > Emgintron  > Edit your custom_rules for Nginx

For domains which have dedicated IP below is the rule which needs to be added

if ($host ~ “oxyxxxxx.com”) {
set $PROXY_DOMAIN_OR_IP “173.1xx.xx5.xxx”;

}

Where you need to set right domain name and  right IP associated with domain

 

If using a shared IP address below is the rule that needs to be added in

Edit yourcustom_rules for Nginx and add below statement

set $PROXY_DOMAIN_OR_IP “XXX.XXX.XXX.XXX”;

Where you need to set shared IP in above example

 

 

 

 

mysqldump: Got error: 1017: Can’t find file: ‘wp_wfBadLeechers’ (errno: 2) when using LOCK TABLES

While making full backup of mysql using below command we got error

mysqldump: Got error: 1017: Can’t find file: ‘wp_wfBadLeechers’ (errno: 2) when using LOCK TABLES

# mysqldump –all-databases > /backup/all_databases.sql

The issue was due to some corrupt tables

Below is the fix used for  making a full dump of database ignoring error

mysqldump –skip-lock-tables -f –all-databases > /backup/all_databases.sql

Mysql backup was completed ignoring the corrupt tables.

 

 

 

 

 

Your server’s MySQL/MariaDB RPM target is set to “unmanaged”. cPanel

Was getting this error while trying to upgrade mysql in WHM/cPanel,

Your server’s MySQL/MariaDB RPM target is set to “unmanaged”. You cannot use the MySQL/MariaDB Upgrade feature while your server is in this state.

The issue was due to entry in file /var/cpanel/rpm.versions.d/local.versions set mysql to unmanaged

Went ahead and set it to managed and was able to upgrade mysql from WHM without any issues

 

 

 

Sorry, the domain xx.xx.104.in-addr.arpa is owned by another user (nobody)

While adding rDNS file in cpanel server I was getting below mentioned error

Sorry, the domain xx.xx.104.in-addr.arpa is owned by another user (nobody)

I have found that at one point in the past this domain was present on this server.

I have removed remnants of the domain from /var/cpanel/users/system and removed references to it from /etc/userdomains and /etc/remotedomains.

I then rebuilt the various caches:

====
/scripts/updateuserdatacache
/scripts/updateuserdomains
====

I am now able to add zone file without any issues

 

Ignore table and dump mysql database

-bash-4.1# mysqldump satmn13_drup189 > satmn13_drup1891.sql
mysqldump: Got error: 1146: Table ‘satmn13_drup189.dr_cache_admin_menu’ doesn’t exist when using LOCK TABLES

-bash-4.1# mysqldump satmn13_drup189 –ignore-table=satmn13_drup189.dr_cache_admin_menu > satmn13_drup1891.sql

Emails going to Spam folder issue

We do get complaints of emails going to spam folder most of the times while working.

The solution to such a issues depends on 3 things

  1. rdns for the IP address and matching A record for the domain name in question.
  2. Need to setup right SPF
  3. Need to setup right DKIM

a) To setup SPF for a domain name can use tool http://www.spfwizard.net/

b) For DKIm you can use tool  from Socketslab

Domain Key / DKIM Generation Wizard

for DKIm you can use key name as key1 or domain1 or any random words

c) Once done you can check whether its valid or not using a vaiidator

http://dkimvalidator.com/results

For validitor you need to send email to email ID shown on screen and check once done click on show results

Where it will show if set  DKIM and spf are valid or not

 

 

 

Error: exim logged Undefined subroutine &main::user2uid called. LOG: MAIN

Exim error :
LOG: MAIN
cwd=/root 4 args: /usr/sbin/exim -i -v testemail@gmail.com
LOG: MAIN REJECT
F=<root@darkmatter.dnsprotect.com> rejected by non-SMTP ACL: failed to expand ACL string "${if eq{$originator_uid}{${perl{user2uid}{nobody}}}{1}{0}}": Undefined subroutine &main::user2uid called. LOG: MAIN
cwd=/var/spool/exim 8 args: /usr/sbin/exim -v -t -oem -oi -f <> -E1UY3r2-000
root@server-web [~]# /scripts/buildeximconf
Configuration file passes test! New configuration file was installed.
/etc/exim.pl.local.build syntax OK
Enabled system filter options: attachments|spam_rewrite
..........
...
........
/etc/exim.pl.local installed!
razor2 is not installed, disabling it in SpamAssassin to save memory
pyzor is not installed, disabling it in SpamAssassin to save memory
SPF is disabled in exim or unavailable, enabling SPF for SpamAssassin
Refreshing SMTP Mail protection.
root@server-web [~]# cp -rpf /etc/exim.pl.local /etc/exim.pl

Disable Strict Mode mysql mariadb

While working on WHMCS I was not able to generate tickets

I found out issue was due to mysql being in strict mode

I tried disabling mysql strict mode  by adding entries in  /etc/my.cnf

sql_mode=””

However it didnt work out.

I have found that there is a /usr/my.cnf file that is enabling strict mode on  server.

This file contained the following:

====
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
====

I removed the STRICT_TRANS_TABLES option and saved the file. All that is left is to restart the MySQL server. You can do this at your convenience with the following command:

====
/scripts/restartsrv_mysql
====

Once it is restarted, strict mode should be disabled.

mysqldump: Error: ‘Out of resources when opening file ‘/tmp/#sql_466b_2.MAI’

While creating of backup of mysql I was getting below error

mysqldump: Error: ‘Out of resources when opening file ‘/tmp/#sql_466b_2.MAI’ (Errcode: 24 “Too many open files”)’

The error is due to Mysql exceeding the limit of open files on mysql

So I just went ahead and saw the open file limit

MariaDB [(none)]> SHOW VARIABLES LIKE ‘open%’
->
-> ;
+——————+——-+
| Variable_name | Value |
+——————+——-+
| open_files_limit | 1024 |
+——————+——-+
1 row in set (0.00 sec)

 

I went ahead and added a parameter in /etc/my.cnf and restarted mysql to fix this issue

open_files_limit = 5000

 

 

[AuthFailure] Either the username was not recognised, or the password was incorrect)

Getting error on XVNC for password authentication

I could see below error in logs

[AuthFailure] Either the username was not recognised, or the password was incorrect)

After googling I found vnc server will need to be restarted once password is reset

root@online [~]# /etc/init.d/vncserver-virtuald restart
root@online [~]# /etc/init.d/vncserver-x11-serviced restart

Now VNC work fine