Tuesday, November 11, 2008

Get started with mysql command line

"Command line" has always been a nightmare to me. Bumping into it and you'll find no clue to get out. Well then, we must make things run smoothly before we can see any of its good points over GUI.

You've been in Windows for years, writing, running, even swimming... so you can easily start and master SQL Server in no time. But those were the days. Having Mysql Server installed, I'm now sailing without a working compass. Haizz... Take it easy, we'll get through it, one day... ^_^

If you have SQL servered installed typically, all the things will roll out before your eyes as long as you have the administrative access. USER databases, and SYSTEM databases that store information about the data storage. Well, then, 1st question, where is system information stored in Mysql Server?

Be satisfied by the SYSTEM VARIABLES for the time being. System varaiables indicate how mysql is configured, each has a default value. These values can be set using
- cmd line
- option file

Try this

mysql> show variables;

and this is the results



So it is better that you know what you are looking for, using this syntax:

mysql> show variables like "%datadir%";


Are you wondering how can we know what exactly we are looking for? :D Here, here, some names, for using in another day...

auto_increment_offset
automatic_sp_privileges
character_set_client
character_set_connection
character_set_database
character_set_server
connect_timeout
datadir
date_format
datetime_format
default_week_format
have_csv : YES if mysqld supports CSV tables, NO if not

Mysql Manual is an official (and thus reliable) source to clarify what these names mean. Or just 'show' them and guess, if you like (in fact, i love that 'type-and-see' method rather than looking-it-up in a km-long documentation!)

Thursday, November 6, 2008

Upgrading Perl

Prior to upgrading Perl, it is a good idea to ensure that each module gets carried over to the update Perl version using the "autobundle" CPAN feature. You will need to execute this command via root in SSH:

perl -MCPAN -e 'autobundle'

Once this is complete, you should have the the following outputted before returning to the shell:

'Wrote bundle file /home/.cpan/Bundle/Snapshot_2007_08_16_00.pm'

Make a note of the filename before proceeding with the update.  

- To update to Perl 5.8.8 on Linux based servers:

cd /root
wget http://layer1.cpanel.net/perl588installer.tar.gz 
tar -zxf perl588installer.tar.gz
cd perl588installer
./install

- To update to Perl 5.8.8 on FreeBSD based servers:

cd /usr/ports/lang/perl5
make && make install

Once the update is complete, you can restore all the previously installed modules from the CPAN bundle that was created by executing:

perl -MCPAN -e 'install Bundle::Snapshot_2007_08_16_00'

Make sure that you replace the bundle name with the one that was generated earlier.

We should now make sure that all modules required by cPanel 11 are installed and restart cPanel:

/usr/local/cpanel/bin/checkperlmodules
/usr/local/cpanel/startup

Ten Things You (Probably) Didn't Know About Perl

http://www.ddj.com/architect/184416222