Posted in Quick Tips & Tricks by tux |
Assuming you already have mysql server installed on your machine, the reason you are
installing phpmyadmin is to ease your administration of your MySQL like database creation and deletion, create/alter/drop/view tables and execute any SQL statements, privilege and trigger management, stored procedures, and backup/ maintenance
phyMyAdmin is a tool built in PHP to manage and administer your MySQL servers via your browser.
Requirements:
1.PHP
2.MySQL
3.php-mysql
4.gd/gd-devel
5. Apache
Posted in Quick Tips & Tricks by tux |
There are ways to sync two MySQL tables in a non-GUI method such as mysql triggers or by Maatkit’s MySQL Table Sync, but it’s not that user-friendly.
Of course, if you want the GUI-type, there’s always the ever dependable phpMyAdmin or the NaviCat program.
On this tutorial, I will be implementing the “TableSyncer” tool, a ruby gem built that was originally detailed on http://code.google.com/p/ruby-roger-useful-functions/wiki/TableSyncer
This was tested on CentOS 5.3 32-bit running in Pentium4@3.0GHz 1G machine.
Here are the step-by-step procedure:
1. Download rubygem by “yum” or by source. This is how I built the rubygem
#wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar zxvf rubygems-1.3.5.tgz
This is a preview of
Sync MySQL tables via ruby gem TableSyncer
.
Read the full post (895 words, estimated 3:35 mins reading time)
Posted in Quick Tips & Tricks by tux |
I had the chance to work as a systems administrator in an e-commerce company and they have Linux dedicated servers leased/purchase from a hosting provider.
Dedicated servers compared to a shared hosting is you have full control of the box. You can do whatever you want with the box, implement services and of course a full root access with the machine.
With this company, we are hosting about 200+ websites and some of them are hosted in our boxes run in Redhat Enterprise Linux. As part of administering the box is to have a full and incremental backup of our dynamic website files and database. Scheduled shell scripts are set on this machine and luckily, I was able to find one of the useful backup solution script that can be found in this site:
This is a preview of
Backup Server files and MySQL database via FTP
.
Read the full post (513 words, estimated 2:03 mins reading time)
Posted in Quick Tips & Tricks by tux |
Here’s one trick to do that:
Step 1. Install FreeTDS
FreeTDS Website: http://www.freetds.org/ choose FreeTDS source distribution
Compile parameter: –prefix=/usr/local/freetds –enable-msdblib
Then, copy /etc/ld.so.conf, to /usr/local/freetds/lib; and then run ldconfig
Step 2. Change /usr/local/freetds/etc/freetds.conf
[sql2k]
host = your.mssql.server.ip
port = 1433
client charset = cp950
tds version = 8.0
b. tds version: 4.2 (for MS SQL Server 6.x); 7.0 (for 7.x); 8.0 (for 2000)
Step 3. Test FreeTDS connect to MS SQL Server
#cd /usr/local/freetds/bin
#./tsql -S sql2k -U sa
1> use mydatabase
2> select * from mytable
3> go
This is a preview of
quick tip: how to connect linux to MSSQL
.
Read the full post (238 words, estimated 57 secs reading time)
Posted in Quick Tips & Tricks by tux |
These are the steps on adding additional hard drives on a pre-installed Linux server.
Drives will be detected and can be checked thru the “dmesg” command.
[root@localhost ~]#fdisk /dev/cciss/c0d1
press n to create partition, just use the default settings for it
press w to write exit
3. Create ext3 filesystem
[root@localhost ~]# mkfs.ext3 /dev/cciss/c0d1p1
4. Mount that drive to test but first create a directory where to mount it.
[root@localhost ~]#mkdir /data
[root@localhost ~]#mount -t auto /dev/cciss/c0d1p1 /data
This is a preview of
Quick tip: Adding new hard drives on an installed Linux Server
.
Read the full post (314 words, estimated 1:15 mins reading time)
Posted in Quick Tips & Tricks by tux |
1.compile cronolog (http://cronolog.org) and install it on /usr/local/sbin
2. backup orig /usr/local/apache-tomcat-5.5.20/bin/catalina.sh on /root
3. edit lines on catalina.sh from
org.apache.catalina.startup.Bootstrap “$@” start \
>> “$CATALINA_BASE”/logs/catalina.out 2>&1 &
to
org.apache.catalina.startup.Bootstrap “$@” start 2>&1 \
| /usr/local/sbin/cronolog “$CATALINA_BASE”/logs/catalina.out.%Y-%m-%d >> /dev/null &
4. Removed the line
touch “$CATALINA_BASE”/logs/catalina.out
5. Restart web service
#/usr/local/tomcat/bin/shutdown.sh
# service httpd stop
# /usr/local/tomcat/bin/startup.sh
#service httpd start
TESTING
1. Check tomcat logs to see generated Catalina.out per day
# ls -la /usr/local/tomcat/logs
-rw-r–r– 1 root root 65607 Nov 6 14:55 catalina.out.2007-11-06
2. browse ww2.freelinuxtutorials.com and login using test account to see if tomcat is working
This is a preview of
quick tip: rotating tomcat logs via cronolog
.
Read the full post (121 words, estimated 29 secs reading time)
Posted in Quick Tips & Tricks by tux |
Quick tip in backing up and restore your MySQL database:
Backing up and Restoring MySQL database
Backing up database:
Syntax:
mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
o [username] -database username
o [password] -password for your database
o [databasename] – the name of your database
o [backupfile.sql] – the file to which the backup should be written.
Example:
mysqldump -u root -p asterisk > asteriskbackupmarch3.sql
(just input the password when prompt for password)
Multiple database:
Syntax:
mysqldump -u [username] -p [password] –databases [databasename1] [databasename2] > [backupfile.sql]
Example:
mysqldump -u asteriskuser -p –databases asterisk asteriskcdrdb > multibackup.sql
(then input db password)
Posted in Quick Tips & Tricks by tux |
How to check if perl module is installed?
A. Checking if Perl Module is Installed
This is important on checking if a given perl module is already installed or not.
Code:
#perl -MModule::Name -e 1
if present, no errors appeared:
[root@darwin ~]# perl -MNet::SNMP -e 1
without:
[root@darwin ~]# perl -MNet::Telnet -e 1
Can’t locate Net/Telnet.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/local/lib/perl5/site_perl /usr/lib/perl5/site_perl .).
BEGIN failed–compilation aborted.
B. Check if the documentation of a perl module is installed.
Code:
perldoc Module::Name
e.g.