Installing MYSQL in Fedora 9

Scenario: ( MYSQL CRASHED , for me , amidst 5GB data import as I got a power failure in between and UPS going off in 20 minutes.)
Prevention: Getting the CPU battery extra backup till it writes the last of the query to filesystem.

Download the mysql recent version from mysql website at http://dev.mysql.com/downloads/mysql/
Best is to download the below:
MySQL-client-community-5.0.67-0.rhel5.i386.rpm
MySQL-server-community-5.0.67-0.rhel5.i386.rpm
MySQL-shared-compat-5.0.67-0.rhel5.i386.rpm
MySQL-devel-community-5.0.67-0.rhel5.i386.rpm
MySQL-shared-community-5.0.67-0.rhel5.i386.rpm

Now let us see what all we got in our box:
[root@nerd1 /]# rpm -qa | grep -i mysql

MySQL-server-standard-4.1.22-0.rhel4
mysql-administrator-5.0r12-1fc5
MySQL-devel-standard-4.1.22-0.rhel4
MySQL-client-standard-4.1.22-0.rhel4
mysql-query-browser-5.0r12-1fc5
mysql-migration-toolkit-5.0r12-1fc5
mysql-gui-tools-5.0r12-3.fc8
MySQL-shared-compat-4.1.22-0.rhel4

Remove each one with ‘rpm -e filename’ at shell prompt for eg:- [….]#rpm -e MySQL-server-standard-4.1.22-0.rhel4
If want a neat way, and do not want any dependency checks and related issues, try yum command.
————————————————————–
Remove option 1
————————————————————–
[root@nerd1 /]# rpm -e mysql-gui-tools-5.0r12-3.fc8
error: Failed dependencies:
mysql-gui-tools = 5.0r12 is needed by (installed) mysql-administrator-5.0r12-1fc5.i386
mysql-gui-tools = 5.0r12 is needed by (installed) mysql-query-browser-5.0r12-1fc5.i386
mysql-gui-tools = 5.0r12 is needed by (installed) mysql-migration-toolkit-5.0r12-1fc5.i386
[root@nerd1 /]# rpm -e MySQL-server-standard-4.1.22-0.rhel4
[root@nerd1 /]# rpm -e mysql-administrator-5.0r12-1fc5
error: Failed dependencies:
mysql-administrator is needed by (installed) mysql-gui-tools-5.0r12-3.fc8.i386
[root@nerd1 /]# rpm -e MySQL-client-standard-4.1.22-0.rhel4
[root@nerd1 /]# rpm -e MySQL-devel-standard-4.1.22-0.rhel4
[root@nerd1 /]# rpm -e mysql-migration-toolkit-5.0r12-1fc5
[root@nerd1 /]# rpm -e MySQL-shared-compat-4.1.22-0.rhel4
[root@nerd1 /]# rpm -e mysql-query-browser-5.0r12-1fc5
error: Failed dependencies:
—————————————————————

—————————————————————
Remove option 2
—————————————————————

[root@nerd1 Desktop]# yum remove ‘*mysql*’
Setting up Remove Process
fedora                    100% |=========================| 2.1 kB    00:00
updates                   100% |=========================| 2.6 kB    00:00
skype                     100% |=========================|  951 B    00:00
Resolving Dependencies
–> Running transaction check
—> Package mysql-administrator.i386 0:5.0r12-1fc5 set to be erased
—> Package mysql-query-browser.i386 0:5.0r12-1fc5 set to be erased
—> Package mysql-gui-tools.i386 0:5.0r12-3.fc8 set to be erased
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package                 Arch       Version          Repository        Size
=============================================================================
Removing:
mysql-administrator     i386       5.0r12-1fc5      installed         8.8 M
mysql-gui-tools         i386       5.0r12-3.fc8     installed          19 k
mysql-query-browser     i386       5.0r12-1fc5      installed         6.6 M

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       0 Package(s)
Remove       3 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing   : mysql-administrator          ######################### [1/3]
Erasing   : mysql-query-browser          ######################### [2/3]
Erasing   : mysql-gui-tools              ######################### [3/3]

Removed: mysql-administrator.i386 0:5.0r12-1fc5 mysql-gui-tools.i386 0:5.0r12-3.fc8 mysql-query-browser.i386 0:5.0r12-1fc5
Complete!
—————————————————————————–

Now try ,
[root@nerd1 mysql_related]# yum remove ‘*mysql*’
and,
[root@nerd1 mysql_related]# yum remove ‘*Mysql*’

The result assures you , all went smooth. Now let us begin, but two more checks.
[root@nerd1 mysql_related]# rm -Rf  /var/lib/mysql/*.*
[root@nerd1 mysql_related]# rm -Rf  /var/lock/subsys/mysql/*.*

( above steps help avoid issues like “Starting MySQL……………….Manager of pid-file quit w[FAILED]pdating file” later )

Now let us begin installing the rpms community server, client as below:

[root@nerd1 Desktop]# rpm -iv MySQL-server-community-5.0.67-0.rhel3.i386.rpm
…………………………..
Preparing packages for installation…
MySQL-server-community-5.0.67-0.rhel3
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h nerd1 password ‘new-password’

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Starting MySQL..[  OK  ]
Giving mysqld 2 seconds to start
……………………………..

[root@nerd1 Desktop]# rpm -iv MySQL-client-community-5.0.67-0.rhel3.i386.rpm
Preparing packages for installation…
MySQL-client-community-5.0.67-0.rhel3

ok, so seems all went fine.let us check client and test mysql
[root@nerd1 Desktop]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.67-community MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> CREATE DATABASE servercsa;
Query OK, 1 row affected (0.00 sec)

mysql> quit

————————————————————————
////////////////////////////////////////////////////////////////////////
Check out for the part 2 : Install MySQL GUI Tools
////////////////////////////////////////////////////////////////////////
————————————————————————

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: