red hat 5.6 uninstall

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%]
trojan81Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thomasbau65Commented:
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
trojan81Author Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

trojan81Author Commented:
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
Joseph GanSystem AdminCommented:
# tar -xvf MySQL-5.5.16-1.rhel5.x86_64.tar
0
trojan81Author Commented:
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
ddiazpCommented:
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
Joseph GanSystem AdminCommented:
You need to change to the directory where the tar file is to un-tar it.
0
trojan81Author Commented:
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
Joseph GanSystem AdminCommented:
Looks intalled, you can check it by
# rpm -qa MySQL-server-5.5.16-1.rhel5.x86_64
0
trojan81Author Commented:
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
Joseph GanSystem AdminCommented:
Sorry, it should be
# rpm -qa | grep MySQL-server-5.5.16-1.rhel5.x86_64
0
trojan81Author Commented:
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
Joseph GanSystem AdminCommented:
Yep, thats the one.
0
trojan81Author Commented:
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
Joseph GanSystem AdminCommented:
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
eagerCommented:
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
trojan81Author Commented:
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
ddiazpCommented:
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
ddiazpCommented:
Edit:   replace 'mysqld' with  'mysql-server' if mysqld doesn't work for the first 2 commands above
0
eagerCommented:
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
arnoldCommented:
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
trojan81Author Commented:
Everyone thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.