This show you how to backup and restore mysql db.
Export
mysqldump -u root -h localhost -p db_name > db_name
Import
mysql -u mysql_account-p -h localhost db_name< db_name
This show you how to backup and restore mysql db.
Export
mysqldump -u root -h localhost -p db_name > db_name
Import
mysql -u mysql_account-p -h localhost db_name< db_name
CREATE USER 'xxx'@'%' IDENTIFIED BY 'yyy';
GRANT USAGE ON * . * TO 'xxx'@'%' IDENTIFIED BY 'yyy' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
CREATE DATABASE IF NOT EXISTS `xxx` ;
GRANT ALL PRIVILEGES ON `xxx` . * TO 'xxx'@'%';
On the client that requires to login to the remote, execute the following command to generate the public and private keys.
[root@localhost ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
3e:b1:6d:44:73:e6:ca:af:3c:06:48:f1:f2:c1:5a:b6 root@localhost.localdomain
append the public key to the remote server
on the client
cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwA3AQEAsr8DueNT........... root@localhost.localdomain
on the server
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwA3AQEAsr8DueNT........... root@localhost.localdomain"
>> ~/.ssh/authorized_keys2
You may need to change root@localhost.localdomain to suit your need.
Create if /etc/sysconfig/static-routes does not exist.
# Routing to HK
eth0 net 192.168.2.0 netmask 255.255.255.0 gw 172.16.1.6
eth0 net 192.168.1.8 netmask 255.255.255.248 gw 172.16.1.6
# Routing to Japan
eth0 net 192.168.3.0 netmask 255.255.255.0 gw 172.16.1.1
eth0 net 192.168.4.0 netmask 255.255.255.0 gw 172.16.1.1
hwclock --systohc
If your email is blocked by ClamAV with Virus oversized.zip, you are hitting a bug in Mail::ClamAV perl module. To fix this, you will need to install the latest ClamAV module
perl -MCPAN -eshell
install Mail::ClamAV
If it’s LILO, just type “linux single” and that should do it (assuming that “linux” is the lilo label).
If GRUB, hit ‘e”, then select the “kernel” line, hit “e” again, and add ” single” (or just ” 1″) to the end of the line. Press ENTER, and then “b” to boot. (More modern grub uses “a” to append to the boot line)
e.g.
kernel /boot/vmlinuz-2.2.17 root=/dev/hda8 video=matrox:vesa:261 single
perl -MCPAN -eshell
Installing Apache 2.x
./configure \
--prefix=/usr/local/apache \
--enable-info \
--enable-rewrite \
--enable-ssl \
--enable-unique-id \
--enable-deflate \
--enable-usertrack \
--enable-so
make
make install
cp build/rpm/httpd.init /etc/init.d/httpd
chkconfig --add httpd
chkconfig --level 3456 httpd on
Installing PHP required Libraries
http://www.ijg.org/files/jpegsrc.v6b.tar.gz
./configure --enable-shared
mkdir -p /usr/local/man/man1
make
make install
http://www.libpng.org/pub/png/libpng.html
./configure
make
make install
http://voxel.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.9.tar.gz
./configure
make
make test
make install
Install LibMCrypt
http://sourceforge.net/projects/mcrypt
./configure
make
make install
Installing PHP5
./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-openssl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-freetype-dir \
--with-ttf \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mcrypt \
--enable-mbstring \
--enable-bcmath
make
make install
Configuring Apache for PHP
vi /usr/local/apache/conf/httpd.confadd
AddType application/x-httpd-php .phpchange
DirectoryIndex index.php index.html index.html.varphp.ini
copy php.ini-development or php.ini-production to /usr/local/lib/php.iniedit /usr/local/lib/php.ini
timezone = Asia/HongKong
This is a guide to show step-by-step PostgreSQL installation.
./configure
make
su
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test