?
Solved

red hat 5.6 uninstall

Posted on 2011-10-04
23
Medium Priority
?
561 Views
Last Modified: 2012-05-12
Hi experts,

Total newbie Linux newbie here.

I accidentally installed the wrong version of mysql on my new linux server:
 
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Kernel 2.6.18-238.el5 on an x86_64

I downloaded the correct version and  before installing it I want to remove the one I installed. how can I do that?

This is how I installed it:

[root@linuxsvr20 /]# rpm -ivh MySQL-server-community-5.1.59-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server-community ########################################### [100%]
0
Comment
Question by:trojan81
  • 9
  • 6
  • 3
  • +3
23 Comments
 
LVL 81

Accepted Solution

by:
arnold earned 672 total points
ID: 36912544
rpm -e MySQL-server-community-5.1.59-1
What do you mean it is the wrong one?
5.6 usually have mysql 5.0 if you need 5.1 or 5.5 you can install it with the knowledge that redhat updates will not be provided/included when you update your system.
0
 
LVL 1

Assisted Solution

by:thomasbau65
thomasbau65 earned 332 total points
ID: 36912564
try to run:

rpm -qa | grep -i MySQL-server-community

you should then find the <package name>

then:

rpm -e <package name> (with out the "<"...)
0
 

Author Comment

by:trojan81
ID: 36913067
i will try it. Arnold I mean it's the wrong one because it's an old version. I will install this one:

MySQL-5.5.16-1.rhel5.x86_64.tar

I am just trying to get the pre-requisites ready for an application that the vendor will help me load. It said to load SQL > 5.0. Couldn't hurt to load the latest.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:trojan81
ID: 36913110
It uninstalled fine:

[root@linuxsvr20 ~]# rpm -qa | grep -i MySQL-server-community
MySQL-server-community-5.1.59-1.rhel5
[root@linuxsvr20 ~]# rpm -e MySQL-server-community-5.1.59-1.rhel5
[root@linuxsvr20 ~]#


can you tell me how to extract it so I can install?

[root@linuxsvr20 ~]# rpm -ivh MySQL-5.5.16-1.rhel5.x86_64.tar
error: open of MySQL-5.5.16-1.rhel5.x86_64.tar failed: No such file or directory
[root@linuxsvr20 ~]#
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 36913125
# tar -xvf MySQL-5.5.16-1.rhel5.x86_64.tar
0
 

Author Comment

by:trojan81
ID: 36913157
I am getting

tar -xvf MySQL-5.5.16-1.rhel5.x86_64.tar
tar: MySQL-5.5.16-1.rhel5.x86_64.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

the file is placed in the root directory.
0
 
LVL 10

Assisted Solution

by:ddiazp
ddiazp earned 664 total points
ID: 36913185
looks like you downloaded the source instead of the rpm package.

you'll need the command ganjos posted to extract the contents of the tar file, but then you'll need to compile and install it manually.

after the tar command is done, type:

cd MySQL-5.5.16-1.rhel5.x86_64
./configure (and wait)
make (and wait more)
make install (and wait more again)


look out for any errors, if this is a new build it may not have the required gcc compilers..


You can get away by just doing:

yum install mysqld

It will download and install it for you

0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 36913214
You need to change to the directory where the tar file is to un-tar it.
0
 

Author Comment

by:trojan81
ID: 36913472
wow linux for newbies is tough

I extracted it. It didnt work before because I was not in the root directory where the file is.

[root@linuxsvr20 /]# ls
bin         mnt                                            root
boot        MySQL-5.5.16-1.rhel5.x86_64.tar                sbin
data        MySQL-client-5.5.16-1.rhel5.x86_64.rpm         selinux
dev         MySQL-devel-5.5.16-1.rhel5.x86_64.rpm          srv
etc         MySQL-embedded-5.5.16-1.rhel5.x86_64.rpm       svm_installer
home        MySQL-server-5.5.16-1.rhel5.x86_64.rpm         svm_update.tgz
lib         MySQL-shared-5.5.16-1.rhel5.x86_64.rpm         sys
lib64       MySQL-shared-compat-5.5.16-1.rhel5.x86_64.rpm  tftpboot
lost+found  MySQL-test-5.5.16-1.rhel5.x86_64.rpm           tmp
media       opt                                            usr
misc        proc                                           var


I belive I need to install the MYSQL server. I ran this:

[root@linuxsvr20 /]# rpm -ivh MySQL-server-5.5.16-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]

And that's all that happened. Does that mean it is installed?
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 36913482
Looks intalled, you can check it by
# rpm -qa MySQL-server-5.5.16-1.rhel5.x86_64
0
 

Author Comment

by:trojan81
ID: 36913496
it just goes to the next line when I paste that in. nothing displays.
I guess it's not installed.
I would think I should see a directory for myql but i dont see it.
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 36913516
Sorry, it should be
# rpm -qa | grep MySQL-server-5.5.16-1.rhel5.x86_64
0
 

Author Comment

by:trojan81
ID: 36913535
Does this look right?


[root@linuxsvr20 /]# rpm -qa | grep -i MySQL-server-5.5.16-1.rhel5.x86_64
[root@linuxsvr20 /]#
[root@linuxsvr20 /]# rpm -qa | grep -i MySQL-server
MySQL-server-5.5.16-1.rhel5
[root@linuxsvr20 /]#
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 36913556
Yep, thats the one.
0
 

Author Comment

by:trojan81
ID: 36913610
Thanks a bunch ganjos. Linux does not seem to be as intuitive as Windows. However, I will need to study it.

What part of that display above tells you that it is installed?
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 36913624
Well, better way to check the following content

Content of RPM :
/etc/init.d/mysql
/etc/logrotate.d/mysql
/etc/my.cnf
/usr/bin/innochecksum
/usr/bin/my_print_defaults
/usr/bin/myisam_ftdump
/usr/bin/myisamchk
/usr/bin/myisamlog
/usr/bin/myisampack
/usr/bin/mysql_convert_table_format
/usr/bin/mysql_fix_extensions
/usr/bin/mysql_install_db
/usr/bin/mysql_plugin
/usr/bin/mysql_secure_installation
/usr/bin/mysql_setpermission
/usr/bin/mysql_tzinfo_to_sql
/usr/bin/mysql_upgrade
/usr/bin/mysql_zap
/usr/bin/mysqlbug
/usr/bin/mysqld_multi
/usr/bin/mysqld_safe
/usr/bin/mysqldumpslow
/usr/bin/mysqlhotcopy
/usr/bin/mysqltest
/usr/bin/perror
/usr/bin/replace
/usr/bin/resolve_stack_dump
/usr/bin/resolveip
/usr/lib64/mysql/libtcmalloc_minimal.so
/usr/lib64/mysql/plugin/adt_null.so
There is 162 files more in these RPM.






0
 
LVL 8

Expert Comment

by:eager
ID: 36918040
Recommendation:  NEVER run commands as root, unless absolutely necessary.  NEVER build programs as root.  There are many opportunities to screw up your system.   If you need to install software use the installer, which you can find under System Settings.

Recommendation:  Always use a package built for your distribution if it is available.  Building from source offers more flexibility, but (especially with a complex package) can require installing other packages to resolve build errors.
0
 

Author Comment

by:trojan81
ID: 36919442
Eager if I give you my version, can you recommend which version I need to download?
My prerequisite is to get an application software loaded into the /root directory and mysql installed.

I seem to be stucked on mysql.

My linux server version is:
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Kernel 2.6.18-238.el5 on an x86_64


I have this extracted to the root directory:
MySQL-server-5.5.16-1.rhel5.x86_64.rpm

I ran this command, but it does not appear to install correctly. It never asked me to create a username and password like the documentation says.

[root@linuxsvr20 /]# rpm -ivh MySQL-server-5.5.16-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]


 
0
 
LVL 10

Assisted Solution

by:ddiazp
ddiazp earned 664 total points
ID: 36919659
It won't ask you to create username or passwords. Seems like mysql installed correctly actually.

execute:

chkconfig mysqld on
service mysqld start
netstat -ntlp | grep 3306   (to make sure mysqld is started and listening).


If above succeeds, do:

mysqladmin -u root password NEWPASSWORD  (to set up your mysqld root pwd)

after that, type:

mysql -u root -p

to log into mysql console
0
 
LVL 10

Expert Comment

by:ddiazp
ID: 36919665
Edit:   replace 'mysqld' with  'mysql-server' if mysqld doesn't work for the first 2 commands above
0
 
LVL 8

Assisted Solution

by:eager
eager earned 332 total points
ID: 36919889
Rather than installing an RPM, I recommend using either Package Kit or yum.  If you run "yum search mysql" you will get a (long) list of packages which contain MySQL and related programs. For example, you should also see the phpMyAdmin package which can be used to manage your database using a web browser.  These packages are all configured for your system, so you don't need to be concerned about whether they are the correct versions.

You can run "yum install mysql" and yum will install the base program and any required prerequisites.  

/root is not the "root" of the file system.  It is a home directory used by the "root" user.  You should not install any software in this directory.

As @ddiazp says, you need to run mysqladmin to set passwords.  
0
 
LVL 81

Assisted Solution

by:arnold
arnold earned 672 total points
ID: 36919949
what happens if you do
mysql should log you in as root if you are root -u root if you are attempting to run mysql as a non root user.
if not use mysql -u root -p and use the root password which should log you in if the password is set by the RPM and would usually be that of the root account.
 
you may need to run mysqld_install_db to create the mysql base security table.
The default is no password for root connecting on localhost.

0
 

Author Closing Comment

by:trojan81
ID: 36972247
Everyone thank you.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question