Wednesday, December 21, 2016

Connection refused after yum update

Hi,

I had run yum update command and server updated and installed about 300 different module with kernel. After update complete, webserver(apache) and server didn't reachable. Webserver and ssh connections was said that "Connection refused"

I'm using centos 7.2 and the update include the upgrade to centos 7.3
After a reboot, the server does not change anything. On the last yum update, too many modules have been updated, so I connect in rescue mode and check all the updates the system has done.

sudo yum history list all



sudo yum history info 34































  • Check theses configuration files if theses does not change
    • etc/hosts
    • ect/networks
    • etc/host.conf
    • etc/resolve.conf
    • etc/network/interfaces
  • Mount Disk
    • fdisk -l
    • mount /dev/hda1 /mnt/
    • mount /dev/hda2 /mnt/home/
    • mount -t proc proc /proc
  • You have to chroot yourself on your partition
    • chroot /mnt/
  • Disable firewall
    • systemctl disable firewalld
Source : 

Friday, December 16, 2016

How to temporarily disable a foreign key constraint in MySQL ?

Try DISABLE KEYS or
SET FOREIGN_KEY_CHECKS=0;
make sure to
SET FOREIGN_KEY_CHECKS=1;
after.

Source : http://stackoverflow.com/questions/15501673/how-to-temporarily-disable-a-foreign-key-constraint-in-mysql

Tuesday, December 13, 2016

How To Use Find and Locate to Search for Files on a Linux

https://www.digitalocean.com/community/tutorials/how-to-use-find-and-locate-to-search-for-files-on-a-linux-vps

Save MySQL query results into a text or CSV file

MySQL provides an easy mechanism for writing the results of a select statement into a text file on the server. Using extended options of the INTO OUTFILE nomenclature, it is possible to create a comma separated value (CSV) which can be imported into a spreadsheet application such as OpenOffice or Excel or any other applciation which accepts data in CSV format.
Given a query such as
SELECT order_id,product_name,qty FROM orders
which returns three columns of data, the results can be placed into the file /tmo/orders.txt using the query:
SELECT order_id,product_name,qty FROM orders
INTO OUTFILE '/tmp/orders.txt'
This will create a tab-separated file, each row on its own line. To alter this behavior, it is possible to add modifiers to the query:
SELECT order_id,product_name,qty FROM orders
INTO OUTFILE '/tmp/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
In this example, each field will be enclosed in “double quotes,” the fields will be separated by commas, and each row will be output on a new line separated by a newline (\n). Sample output of this command would look like:
"1","Tech-Recipes sock puppet","14.95" "2","Tech-Recipes chef's hat","18.95"
...
Keep in mind that the output file must not already exist and that the user MySQL is running as has write permissions to the directory MySQL is attempting to write the file to.