How to export from mysql into csv file
If you need to export from mysql into csv file, what you have to do is the following:
SELECT * INTO OUTFILE '/tmp/myfile.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM my_table;
to import the results from csv into mysql instead the process is the following:
LOAD DATA LOCAL INFILE '/tmp/myfile.csv'
INTO TABLE my_table
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
note: you need to specify all the fields in the table. if in your table there is an AUTO_INCREMENT field just set that column to 0 (zero).
Web 3.0
The 15-minute film (embedded below) is a pretty good general overview of the semantic web. That is, turning all of the data on the web into structured data so as to define relationships between it and derive meaning. Though I enjoy when Hunch co-founder Chris Dixon cautions in the film that "semantic web" is now a "marketing term that’s abused and thrown around."
Web 3.0 from Kate Ray on Vimeo.
monitor server performance
A useful tool to monitor your server performance is munin.
Once you install this tool you can monitor trough web things like:
- Apache
- Disk
- Mysql
- Network
- Postfix
- Processes
- System
is very easy to install, you can use the following commands:
apt-get install munin munin-node
nano /etc/munin/munin.conf
and check this lines:
dbdir /var/lib/munin
htmldir /var/www/mysite/munin
logdir /var/log/munin
rundir /var/run/munin
tmpldir /etc/munin/templates
[server1.mysite.com]
address 127.0.0.1
use_node_name yes
and finally:
mkdir -p /var/www/mysite/munin
chown munin:munin /var/www/mysite/munin
/etc/init.d/munin-node restart