[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1135
  • 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.
0
MaryBarsoum
Asked:
MaryBarsoum
  • 7
  • 6
1 Solution
 
farzanjCommented:
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?
0
 
arnoldCommented:
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.
0
 
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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.
0
 
arnoldCommented:
make sure mysql is not running.
/sbin/service mysqld stop
cd /var/lib/mysql
mv mysql oldmysql
mysql_install_db
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.
0
 
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?
0
 
arnoldCommented:
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.
0
 
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?
0
 
MaryBarsoumAuthor Commented:
when I wrote the above command you gave me I have got the following:
rpm -ql mysql-server
/etc/rc.d/init.d/mysqld
/usr/bin/innochecksum
/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_fix_privilege_tables
/usr/bin/mysql_install_db
/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/lib/mysql/plugin
/usr/lib/mysql/plugin/ha_archive.so
/usr/lib/mysql/plugin/ha_archive.so.0
/usr/lib/mysql/plugin/ha_archive.so.0.0.0
/usr/lib/mysql/plugin/ha_blackhole.so
/usr/lib/mysql/plugin/ha_blackhole.so.0
/usr/lib/mysql/plugin/ha_blackhole.so.0.0.0
/usr/lib/mysql/plugin/ha_example.so
/usr/lib/mysql/plugin/ha_example.so.0
/usr/lib/mysql/plugin/ha_example.so.0.0.0
/usr/lib/mysql/plugin/ha_federated.so
/usr/lib/mysql/plugin/ha_federated.so.0
/usr/lib/mysql/plugin/ha_federated.so.0.0.0
/usr/lib/mysql/plugin/ha_innodb_plugin.so
/usr/lib/mysql/plugin/ha_innodb_plugin.so.0
/usr/lib/mysql/plugin/ha_innodb_plugin.so.0.0.0
/usr/libexec/mysqld
/usr/libexec/mysqlmanager
/usr/share/doc/mysql-server-5.1.56
/usr/share/doc/mysql-server-5.1.56/my-huge.cnf
/usr/share/doc/mysql-server-5.1.56/my-innodb-heavy-4G.cnf
/usr/share/doc/mysql-server-5.1.56/my-large.cnf
/usr/share/doc/mysql-server-5.1.56/my-medium.cnf
/usr/share/doc/mysql-server-5.1.56/my-small.cnf
/usr/share/man/man1/innochecksum.1.gz
/usr/share/man/man1/msql2mysql.1.gz
/usr/share/man/man1/myisam_ftdump.1.gz
/usr/share/man/man1/myisamchk.1.gz
/usr/share/man/man1/myisamlog.1.gz
/usr/share/man/man1/myisampack.1.gz
/usr/share/man/man1/mysql.server.1.gz
/usr/share/man/man1/mysql_convert_table_format.1.gz
/usr/share/man/man1/mysql_fix_extensions.1.gz
/usr/share/man/man1/mysql_fix_privilege_tables.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/mysql_secure_installation.1.gz
/usr/share/man/man1/mysql_setpermission.1.gz
/usr/share/man/man1/mysql_tzinfo_to_sql.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysql_zap.1.gz
/usr/share/man/man1/mysqlbinlog.1.gz
/usr/share/man/man1/mysqlbug.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man1/mysqld_multi.1.gz
/usr/share/man/man1/mysqld_safe.1.gz
/usr/share/man/man1/mysqldumpslow.1.gz
/usr/share/man/man1/mysqlhotcopy.1.gz
/usr/share/man/man1/mysqlimport.1.gz
/usr/share/man/man1/mysqlman.1.gz
/usr/share/man/man1/mysqltest.1.gz
/usr/share/man/man1/perror.1.gz
/usr/share/man/man1/replace.1.gz
/usr/share/man/man1/resolve_stack_dump.1.gz
/usr/share/man/man1/resolveip.1.gz
/usr/share/man/man8/mysqld.8.gz
/usr/share/man/man8/mysqlmanager.8.gz
/usr/share/mysql/config.huge.ini
/usr/share/mysql/config.medium.ini
/usr/share/mysql/config.small.ini
/usr/share/mysql/errmsg.txt
/usr/share/mysql/fill_help_tables.sql
/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/mysql_fix_privilege_tables.sql
/usr/share/mysql/mysql_system_tables.sql
/usr/share/mysql/mysql_system_tables_data.sql
/usr/share/mysql/mysql_test_data_timezone.sql
/var/lib/mysql
/var/log/mysqld.log
/var/run/mysqld
0
 
arnoldCommented:
Yes you have the same packages:
LAMP
Linux
Apache
MySQL
PHP

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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