JAFFAR

Blog

Export mysql query result to csv

Posted by jaffar on September 11, 2013 at 7:10 AM

Export mysql query result to csv

mysql -u <username> -h <hostname> <databasename> -p"<password>" -e  "SELECT title FROM node" -B > /home/tmp/excel1.csv                    

 

Print data to PHP Error Log

 For Windows

ini_set("log_errors", 1);

ini_set("error_log", "D:/wamp/logs/php-error.log");

error_log( "Hello, errors!" );

 

For Linux

ini_set("log_errors", 1);

ini_set("error_log", "/tmp/php-error.log");

error_log( "Hello, errors!" );


Copy files from source to destionation server

   Source directory:  /var/www/html/example1/

        example1 folder contains sub folder and files

   Destination directory: /var/www/html/example2/

 Linux command

  scp -r example1/.   <username>@<hostname>:/var/www/html/example2/

 

compress file in linux command

tar -czvf  sample.gz  sample

tar -czvf  <compressfilename>.gz  <folder name>

 

 

 Unzip file in linux command

tar xzvf   <filename>.tar.gz

Remove files in Linux command

To remove all files & subdirectories from a directory (MS-DOS deltree like command), enter:

rm -rf test.txt

 Change Permission in Linux command

 

chown -R 48.48  drupal6/sites/default/files

chmod -R 755 drupal6/sites/default/files

 

Site not searchable in Google  drupal 6

Add the below code to drupal6/robots.txt file

Disallow: /


 

 


Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

0 Comments