How to Disable MySQL Strict Mode in Linux and Windows


Cheap reseller Hosting


MySQL and MariaDB support strict modes that allow the controlling and handling of invalid or missing values in data-changing queries. This has the following statements INSERT, UPDATE, and CREATE TABLE.

When strict mode is enabled in MySQL then invalid or missing data may cause warnings or errors when trying to move the query.

When strict mode is disabled, a similar query would have its invalid or missing values adjusted and produce a simple warning.

This may seem like the preferred result, but though strict mode is disabled, certain actions may lead to unexpected results. For example, when the character limit is exceeded, it will be shortened to fit the limit.  

There are plenty of reasons why MySQL’s strict mode may require to be disabled. The frequent reason is when a server is operating WHMCS – a requirement of the tool.

Necessities

  • Their guide is specifically for disabling MySQL strict mode on a managed server with cPanel or a Windows server.
  • The server should be accessible to MySQL 5.X or MariaDB 10.X and higher.
  • Command line and root-level access via SSH will be compulsory to follow this tutorial on Linux servers.

Disable MySQL Strict Mode

Step 1: Backup Your Data

It’s always better to have a backup before modifying server files. You have to revert changes if something goes wrong. Backups are also needed to help track changes.

Linux

When logged into SSH with the root user on Linux, with the following Bash brace expansion command to make a backup copy of the file in its original Linux directory.  

cp -a /usr/my.cnf{,.strict.bak}
cp -a /etc/my.cnf{,.strict.bak}

Windows

Windows users must identify and take a backup of the my.ini file. In the start menu, go to Settings > Update & Security > Backup > Add a drive, and then opt for the external drive or network location where you are allowed to store the backups of your machine.

Step 2: Disable MySQL Strict Mode

Based on the server and the current configurations, you may be required to edit one, or both, of the following files on the server. Generally, relevant configuration lines are available. However, it could be in either one without causing issues, so generally, it’s good to go with both.

Linux

In Linux, you can edit the files and open the file with your favorite command line editor. This guide uses Vim:

vim /usr/my.cnf

vim /etc/my.cnf

In vim, you can type a or i to enter text insertion mode; pressing the Esc key on your keyboard will take back you to command mode. For a refresher on editing files with vim, you can check articles on the web. 

Within the file, check the following line.sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

This line is setting the sql_mode variable. Replace it with the following line to disable MySQL strict mode.

sql_mode=""



After adjusting or you’ve to confirm the file that doesn’t need an adjustment, save and close the file.  Press Esc to enter command mode and type:wq to write and end the file.

Windows

The step is similar for Windows, but don’t forgot to locate and open the my.ini file from File Explorer—the standard location for its  C:\ProgramData\MySQL\MySQL Server X.X.

The escape folder is ProgramData. To show a hidden folder, go to the view tab from the menu bar, and click the checkbox next to hidden items in the Show/hide section. Once you identify the my.ini file, open it with Notepad or Notepad ++ and search the following line.

sql-mode = “STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

Change this line in the file to get the mode to blank.

sql-mode = “”

Step 3: Restart the MySQL Service

You have to restart the MySQL service to make these changes, as it will only read the configuration files when it initially loads up.

Linux

For CentOS 7 servers, use this command.

systemctl restart mysql

For CentOS 6 and prior, write this command,

/etc/init.d/mysql restart

After furnishing this command on the server, the MySQL service will restart and load the changes. The MySQL strict mode is now disabled.

You can operate the following command to verify that the process was done properly.

mysql -e “SELECT @@sql_mode;”

Check the example of the output:

+——————————————–+ | @@sql_mode +——————————————–+ | NO_AUTO_CREATE_USER +——————————————–+


Windows

To restart MySQL in Windows, look for and open the Administrative Tools app. Just Double – Click Services. Identify and select MySQL. You are shown the following options on the left:

Stop the service: Stop the selected service.

Pause the service: Pause the selected service.

Restart the service: Restart the selected service.

Click on Restart the service which will redirect to change back to Started.

Conclusion

Disabling Strict Mode in MySQL is a painless task, regardless of why an administrator is required to disable it. Check this article to disable the MySQL Strict Mode for Linux or Windows servers.


Cheap web Hosting


How to : Exim Remove All messages From the Mail Queue


Cheap reseller Hosting


 

Exim is a mail transfer agent (MTA) used on Unix-like operating systems. It aims to be a general and flexible mailer with extensive facilities for checking incoming e-mail. For more information you can see Exim documentation.

Web

In this article i will show some commands to removing all messages from the Mail Queue. Please Follow the Steps. 

 

Step 1 :  To print a list of the messages in the queue, enter the following command :

# exim -bp

 

Step 2 :  To remove a message from the queue, enter the following command :

# exim -Mrm {message-id}

exim-vps

Step 3 :  To remove all messages from the queue, enter the following command :

# exim -bp | awk ‘/^ *[0-9]+[mhd]/{print “exim -Mrm ” $3}’ | bash

 

Step 4 :  Dallas Marlow, suggested following clean command:

# exim -bp | exiqgrep -i | xargs exim -Mrm

 

 

That’s it ! 🙂 🙂


Cheap web Hosting


How to Uploading Files using Unzip in Linux


Cheap reseller Hosting


Uploading Files using Unzip in Linux

When you want to upload large number of files in your web server, you can easy to uploading large number of files by using unzip in Linux. Please follow the steps and quickly upload the necessary files in your linux os.

Uploading Files using Unzip in Linux
Step 1 : To Upload the zipped file to your SSH server.

Step 2 : To Unzip the zipped file to the destination folder.

Step 3 : To test the zipped file by using following command.

unzip -t zip_file_name

zip-files

Step 4 : To extract the zipped file, use the following command.

unzip zip_file_name -d destination_folder

extract file

Note: Don’t forget to use the -d parameter as otherwise you will have nasty errors. Be careful with permissions as well.

 

That’s it !


Cheap web Hosting


How to install PEAR for PHP in Linux


Cheap reseller Hosting


Install PEAR for PHP in Linux

 

-install-PEAR-for-PHP-in-Linux 

                 PEAR is a structured library of open-source code for users of PHP. When pear is not installed in your server, then install it. You can easily install PEAR for php in Linux

In this article we will give you how to install PEAR for php in Linux. Follow the steps for Installing PEAR.

Step 1 : Download the installation php file.

                     http://pear.php.net/go-pear

Step 2 : Rename to php file by using following command.

cp go-pear go-pear.php

Step 3 : Run the php script.

Then, Windows Command Prompt to start the installation.

Step 4 : You can install php various extensions by using following command.

pear install package

 

After installing PEAR, you can install modules by going to the PEAR admin at example :-

hostripples.com/pearadmin, where hostripples.com is your domain name.

 

 


Cheap web Hosting


How to disable core dumps on Linux Servers


Cheap reseller Hosting


To disable core dumps on Linux Servers

Core dump is a memory or a storage dump which records the memory state of a computer program when it was terminated by the operating system due to various error behavior. In this article Hostripples will give you how to disable core dumps on Linux Servers.

disable-core-dumps-on-Linux-Servers

Please follow the steps to disable core dumps for all users : 

Step 1 :  Edit /etc/security/limits.conf and use the following command.

vi /etc/security/limits.conf

Step 2:  Make sure the following config directive exists by using following command. 

hard core 0

Step 3 : Disable core dumps for setuid programs by using following command.

echo ‘fs.suid_dumpable = 0’ >> /etc/sysctl.conf
sysctl -p

Step 4 : Now, Set a soft limit to stop core dumps being created by using following command.

echo ‘ulimit -S -c 0 > /dev/null 2>&1’ >> /etc/profile

That’s it!

 


Cheap web Hosting


How to install Zend Optimizer in Cpanel Linux Server


Cheap reseller Hosting


 

install-Zend-Optimizer

Introduction : 

Zend Server is the most complete PHP distribution with a continuously updated set of advanced value-add features designed to optimize productivity, performance, scalability and reliability. It is a free PHP extension to enable the web server to execute files encoded by Zend Guard/Encoder so it’s executed the same as any regular PHP files. Zend Encoder also is useful for encoding PHP files to protect source code. Zend Server supports any and all PHP code and provides deep insights into that code including the most popular PHP applications and frameworks like WordPress, Magento, Drupal, Zend Framework, Symfony, and Laravel. Any code you have in PHP will run on Zend Server. You will need to install Zend Optimizer in your server running Linux.

 

 

Installing zend in cPanel Linux Server follow this Steps:

Step 1 : Log in to your server via SSH with root user.

Step 2 : Run the following command.

 /scripts/installzendopt

Step 3 : Follow the instructions on the screen to install Zend Optimizer.

Step 4 : Then, Restart the apache.

 service httpd restart

Step 5 : To check whether zend optimizer is running and vserion.

 php -v

It would show ioncube or zend optimizer version.

 

install Zend Optimizer

                             

 

            OR

 

Follow the on-screen instructions.

When you want to install Zend Optimizer on a Non-cPanel server please follow the steps:

Step 1 : Download Zend Optimizer.

http://www.zend.com/en/products/guard/optimizer/

Step 2 : Upload the .tar.gz into your web server.

/home/temp

Step 3 : Extract the archive by using the following command.

tar -zxvf filename_here.tar.gz

Step 4 : Now a new directory should appear.

Step 5 : Execute the following command.

./install.sh

Step 6 : Follow the instructions on-screen.

Step 7 : Restart HTTPD (Apache) by using following command.

service httpd restart

 

 

 

That it !


Cheap web Hosting


Change Linux Root Password Temporarily


Cheap reseller Hosting


How to change Linux root password temporarily

If you are logged in as root and you don’t know the root password then you can follow the steps. You can easy to change your root password. 

 

Step 1. Back-up your current shadow file.

[root@hostripples ~]# cp /etc/shadow /etc/shadowbkup

Step 2. Change the current root password

[root@hostripples ~]# passwd root

Changing password for user root.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

Step 3. Switch to a local user to test whether ‘your’ root password is working or not.

[root@hostripples ~]# su – localuser 
[localuser@hostripples ~]$ su – root
Password:
[root@hostripples ~]#

Yes, you are now logged in as root with ‘your’ password.

Step 4. Restore the previous root password

[root@hostripples ~]# mv /etc/shadowbkup /etc/shadow
mv: overwrite `/etc/shadow’? y
[root@hostripples ~]#

.

.

.

.

This trick is meant for students and kindly do not misuse.


Cheap web Hosting


How to Setup Minecraft on a Linux CentOS Server


Cheap reseller Hosting


Setup Minecraft on a Linux CentOS Server

 

-Setup-Minecraft

 

* First, To download PuTTY to access SSH.

 

* Installing Minecraft by using following command: 

yum install java-1.6.0-openjdk

 

* Switch to the root directory by using following command:

cd

 

* Create a Minecraft directory

mkdir minecraft

 

* Enter the directory by using following command: 

cd minecraft

 

* Download Minecraft by using following line 

wget http://minecraft.net/download/minecraft_server.jar

 

* Now, Using Following Scripts 

chmod +x minecraft_server.jar
yum install screen
screen

 

* Then, Start up Minecraft

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

 

===========================================

 

** To close PuTTY and keep Minecraft running.:

Control + a + d

 

** To get back to the screen where Minecraft is running hold the following keys on your keyboard:

screen -r

 

linux__minecraft


Cheap web Hosting


How to Disable Clamav and Amavis for Postfix


Cheap reseller Hosting


How to disable Clamav and Amavis for postfix

 

If you want to run postfix but not run the antivirus (Clam, Amavis), there is a way to disable those services while allowing postfix to run as normal.

Follow the instructions you can easily to disable Clamav and Amavis for postfix.

 

1) Edit the file/etc/postfix/main.cf

And use the following commands :

content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings

 

2) Edit the file /etc/postfix/master.cf

And use the following commend :

amavis unix – – – – 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
127.0.0.1:10025 inet n – – – – smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_chec ks,no_header_body_checks
-o smtpd_bind_address=127.0.0.1

 

3) To stop the services :

/etc/init.d/amavisd stop
/etc/init.d/clamav-daemon stop
/etc/init.d/clamav-freshclam stop
/etc/init.d/clamd.amavisd stop

 

4) Disable the services from start-up :

chkconfig –levels 235 amavisd off
chkconfig –levels 235 clamav-daemon off
chkconfig –levels 235 clamav-freshclam off
chkconfig –levels 235 clamd.amavisd off

 

5) Reboot your server, and restart postfix by entering :

/etc/init.d/postfix restart

 

 

 

 


Cheap web Hosting


Install Mytop in Linux and Cpanel


Cheap reseller Hosting


How to install mytop in linux and cpanel

 

MySQL is one of the most important programs on a server, unfortunately it is also pretty resource intensive. One a  server it is not uncommon for a single user or even a query to take up the bulk of the servers CPU cycles. Mytop is a very useful program to see what queries a server is currently processing as well as which user is executing them. Think of mytop as top for mysql. If you see a lot from a user that means they are probably the hog. Mytop can also be useful for figuring out exactly which queries are causing the problem in the case of a self-designed website.

 

 

install mytop

 

The following commands use  how to install mytop on the server and run it.

1) To Install Term Read Key:

cd /usr/local/src

wget http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz

tar -zxf TermReadKey-2.30.tar.gz

cd TermRead*

perl Makefile.PL

make test

make

make install

cd ..

 

2) Now,To Install DBI:

wget http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.48.tar.gz

tar -zxf DBI-1.48.tar.gz

cd DBI*

perl Makefile.PL

make test

make

make install

cd ..

 

3) Finally  To Install MYTOP:

wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.4.tar.gz

tar -zxf mytop-1.4.tar.gz

cd mytop*

perl Makefile.PL

make test

make

make install

 

NOTE: You may get following error in CentOS 5.3

Error in option spec: “long|!”

Search for the line in Makefile.PL

“long|!” => \$config{long_nums},

Change it to by commenting using #

#”long|!” => \$config{long_nums},


Cheap web Hosting


1 2