Remove LAMP

Posted on 2011-03-15
Medium Priority
Last Modified: 2013-12-15
How to remove LAMP from Centos5.5?
I have installed it using yum as well as atomic, but I am getting into some problems. I would like to remove everything, but whenever I reinstall MySQL it keeps getting the old root credentials that I don't have.
Question by:MaryBarsoum
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
LVL 31

Expert Comment

ID: 35143904
Reinstall it.  When you do, make sure to destroy and remake partitions or at least reformat the partitions.  Then during package selection, do not select Apache, MySQL or whatever you don't want.

Which version of Linux are you using?
LVL 79

Expert Comment

ID: 35143972
stop mysql, look in /var/lib/mysql/mysql which you can rename.
then run the mysql_install_db
The uninstall of mysql does not remove the databases.

Author Comment

ID: 35144511
I am running CentOS 5.5
How can I destroy and remaking the partitions. I am sorry I have little experience in Linux?
Also what is the command for uninstall mysql and how can I delete all the databases from previous versions? Do I write DROP schema; ? How can I delete all the php files and all the apache and Mysql?
I need to do this in order to make a clean install of LAMP as I am trying to install a web based application that is ginving me lots of errors. So if you can also direct me to a good repository that has all updated for Centos 5.5 that will be very helpful.
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.


Author Comment

ID: 35144634
I had a mySQL installed and in it I have deleted all the users, so maybe what you are telling me about uninstalling MySQL won't remove databases applies to the problem I am running into. This problem is basically I can't access my MySQL with the root credentials.
I have forgot to mention that I have used yum for installation of the components of LAMP and when I had a problem in the root password of MySQL, I have reinstalled it using atomic rep. but still got the same problem of not allowing me to access MySQL. I need to remove any traces for the databases created as well as all the LAMP components and install a new one. So I really need help.
LVL 79

Accepted Solution

arnold earned 2000 total points
ID: 35144702
make sure mysql is not running.
/sbin/service mysqld stop
cd /var/lib/mysql
mv mysql oldmysql
This will recreate a default mysql database with root login without a password/
/sbin/service mysqld start

mysql -u root
will get you into your mysql server and presumably you can take it from here.
If you need, you can then query the oldmysql for configuration information.

Author Comment

ID: 35144834
So Do you think having a combination of installations (like some from yum others from sudo atomic and reinstallations) won't interfere with the stability of the LAMP?
LVL 79

Expert Comment

ID: 35147304
You should select which package manager you want to use and stick with it.
Do you have two versions of mysql installed?
rpm -ql mysql-server
The info I provided deals with how you can regain access to your databases by resetting the mysql permissions.

Author Comment

ID: 35149784
But what I have installed sees each other. I don't know what package install as I have used:
yum install httpd
yum install mysql-server mysql
and then I removed mysql altogether and used the following command:
sudo yum install mysql-server mysql mysql-devel
I think it's all the same and it's all one package that is LAMP, isn't it?

Author Comment

ID: 35150421
when I wrote the above command you gave me I have got the following:
rpm -ql mysql-server
LVL 79

Expert Comment

ID: 35153190
Yes you have the same packages:

when you install a package/remove a package/install a package, the data such as with mysql /var/lib/mysql does not get touched. It remains. Such that if you forget the login you set, no matter how many times you go through the yum remove mysql-server yum install mysql the access will not be changed.

Author Comment

ID: 35166959
Yes I got this the hard way. But if I need to reinstall LAMP, do I just do yum remove for all components and then yum install for every component again? Thank you so much for your help.
LVL 79

Expert Comment

ID: 35167441
LAMP is a short hand for installing Linux as the OS and configuring the server as an Apache web server with PHP and mysql database backend.
The only thing you will be able to remove/reinstall are the components Apache, PHP, and Mysql.
For Linux you have to perform a complete reinstall i.e. boot from the linux install CD.

Author Comment

ID: 35168485
Where can I find a Linux install CD? Is this like an ISO that I can download online? So if I just issued yum remove httpd and yum remove php, yum remove mysql, won't it remove all the components and then I can issue install commands? I need this because when I point my browser to localhost, it gets me a blank page and the same with a php file test. The phpmyadmin is working though! If you have a solution to this then this may be better.
LVL 79

Expert Comment

ID: 35171702
apache, php, mysql are applications and can be removed/reinstalled/removed/reinstalled.
The only thing the remove part will remove is the parts it installed without the configurations nor the data.
So your remove/reinstall will not fix an configuration issue in most cases.

Linux is the underlying OS. You can download the Centos ISO from www.centos.org.
Other options are Debian, Ubuntu. etc.

Files for web access need to be stored in /var/www/html
You can also configure
http://localhost/somedir to display a specific set of data.
What were you expected to see?
You should open a related question since this discussion is way off your original issue.

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 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