Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1136
  • Last Modified:

Remove LAMP

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.
  • 7
  • 6
1 Solution
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?
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.
MaryBarsoumAuthor Commented:
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.
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

MaryBarsoumAuthor Commented:
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.
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.
MaryBarsoumAuthor Commented:
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?
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.
MaryBarsoumAuthor Commented:
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?
MaryBarsoumAuthor Commented:
when I wrote the above command you gave me I have got the following:
rpm -ql mysql-server
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.
MaryBarsoumAuthor Commented:
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.
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.
MaryBarsoumAuthor Commented:
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.
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
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now