Thursday, March 11, 2010

MySql

MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases

The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Sun Microsystems, a subsidiary of Oracle Corporation.

Free-software projects that require a full-featured database management system often use MySQL. Such projects include (for example) WordPress, phpBB and other software built on the LAMP software stack. MySQL is also used in many high-profile, large-scale World Wide Web products including Wikipedia, Google, Drupal and Facebook.

Mysql Installation (RPM)

1. Become the superuser if you are working in your account.
2. Download all rpm packages of Mysql.
3. Change to the directory that has the RPM download.
4. Type the following command at the prompt:

1. rpm -ivh MySQL-client-community-5.1.42-0.rhel5.i386.rpm
2. rpm –ivh MySQL-community-debuginfo-5.1.42-0.rhel5.i386.rpm
3. rpm –ivh MySQL-devel-community-5.1.42-0.rhel5.i386.rpm
4. rpm –ivh MySQL-embedded-community-5.1.42-0.rhel5.i386.rpm
5. rpm –ivh MySQL-server-community-5.1.42-0.rhel5.i386.rpm



RPMs through GnoRPM (found under System).

5. Now we'll set a password for the root user. Issue the following at the prompt.
6. mysqladmin -u root password mypassword

where mypassword is the password for the root. (Change this to anything you like).

7. It is now time to test the programs. Typing the following at the prompt starts the
mysql client program.
8. mysql -u root -p
The system asks for the the password. Type the root password (mysqldata).
If you don't get the prompt for password, it might be because MySQL Server is not running
. To start the server, change to /etc/rc.d/init.d/ directory and issue the command
./mysql start (or mysql start depending on the value of the PATH variable on your system).
Now invoke mysql client program.

9. Once MySQL client is running, you should get the mysql> prompt. Type the following at this prompt:

show databases;
You should now get a display similar to:
+----------------+
| Database |
+----------------+
| mysql |
| test |
+----------------+
2 rows in set (0.00 sec)

Wednesday, March 10, 2010

Mysql Installation on Linux(Binaries)

groupadd mysql
useradd -g mysql mysql
tar -zxvf mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz
rm mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz
ln -s mysql-max-4.1.9-pc-linux-gnu-i686 mysql
cd mysql
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
cp support-files/mysql.server /etc/rc.d/init.d/
chmod +x /etc/rc.d/init.d/mysql.server
chkconfig --add mysql.server