Posts Tagged ‘MySQL’

MySQL quick backup

Sunday, January 27th, 2008

This trick will show you how to quickly perform a MySQL backup. So let’s dump all the contents of your databases and compress them to be more portable.

mysqldump -u root -p –all-databases | gzip > myDatabases.sql.gz

If you now want to dump this data to another server, simply type:

gunzip < myDatabases.sql.gz | mysql -u root -p


Mysqldump manual

Sun Microsystems acquires MySQL AB

Wednesday, January 16th, 2008

From Sun Microsystems web site:

Sun announced an agreement to acquire MySQL AB, an open source icon and developer of one of the world’s fastest growing open source databases. This acquisition accelerates Sun’s position in enterprise IT to now include the $15 billion database market and reaffirms Sun’s position as the leading provider of platforms for the Web economy and its role as the largest commercial open source contributor.

More information from Sun Microsystems, Cnet and MySQL web site.

MySQL: quick replacement

Thursday, December 6th, 2007

Say that you have a table called myTable with several rows and a column called URL that contains the IP address of a log server. Now imagine that you want to change the value of URL so IP address is substituted by the server name. One way to do that is as follows:

use dbname

update myTbl set URL=replace(URL,’′,’logserver’);

Installing MySQL, Apache and PHP in Solaris 10

Monday, December 11th, 2006

This is a quick guide to install PHP4, MySQL4 and Apache2 in Solaris 10. In order to facilitate the management and installation of packages we will use the pkg-get tool. pkg-get is a tool to automate download and installation of binary packages, for example from Blastwave an Open Source software repository for Solaris.

Our first task will be the installation of pkg-get. At Blastwave you’ll find a complete guide on how to undertake this task. Briefly:

cd /tmp
pkgadd -d pkg_get.pkg all
chmod 755 wget-i386.bin


export PATH

vi /opt/csw/etc/pkg-get.conf

Pick a mirror next to you. Then:

pkg-get -i wget


export PATH

And now you may install other packages. But let’s focus in our target.

As Solaris 10 comes with MySQL and Apache installed by default, first we are going to uninstall them. Take a look at your system:

pkginfo | grep -i apache

system SUNWaclg Apache Common Logging
system SUNWapch2d Apache Web Server V2 Documentation
system SUNWapch2r Apache Web Server V2 (root)
system SUNWapch2u Apache Web Server V2 (usr)
system SUNWapchd Apache Web Server Documentation
system SUNWapchr Apache Web Server (root)
system SUNWapchu Apache Web Server (usr)

pkginfo | grep -i mysql

system SUNWmysqlr mysql – MySQL Database Management System (root component)
system SUNWmysqlt mysql – MySQL Database Management System (test component)
system SUNWmysqlu mysql – MySQL Database Management System (usr component)

Next task would be to uninstall these packages. Proceed as follows:

pkgrm SUNWaclg SUNWapch2d SUNWapch2r SUNWapch2u SUNWapchd SUNWapchr SUNWapchu
pkgrm SUNWmysqlr SUNWmysqlt SUNWmysqlu

Finally, install Apache, MySQL and PHP from pkg-get:

pkg-get -i apache2 mysql4 php4 mod_php

That’s all. Now configure the software as usual. Note that packages installed with pkg-get reside in /opt/csw, so I recommed adding something like this to your /etc/profile:

export PATH

More info:

pkg-get installation howto
pkg-get users guide
Customizing Your Working Environment