WebmasterForums.NET - Webmaster Forums & Directory
 

Go Back   WebmasterForums.NET - Webmaster Forums & Directory > Design and Development > Database - Mysql, SQL and Others
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Database - Mysql, SQL and Others MySQL, MSSQL, PGSQL, ms access and other database discussions.

Reply
 
Thread Tools Display Modes
Old 08-05-2006, 04:52 PM   #1
barney
Senior Member
 
barney's Avatar
 
Join Date: Jul 2006
Location: USA
Posts: 203
barney is on a distinguished road
Send a message via ICQ to barney Send a message via AIM to barney Send a message via Yahoo to barney
Default How to Uninstall Mysql

I have intstalled mysql rpm.
By mistake user table entries are deleted. Therefore I could not access mysql.

I want uninstall the same and reinstall it.

Please guide me how to do that .
Thanks
barney is offline   Reply With Quote
Old 08-05-2006, 04:52 PM   #2
barney
Senior Member
 
barney's Avatar
 
Join Date: Jul 2006
Location: USA
Posts: 203
barney is on a distinguished road
Send a message via ICQ to barney Send a message via AIM to barney Send a message via Yahoo to barney
Default

I tried as advised as follows :
I tried to uninstall mysql rpm as
rpm -e /var/lib/mysql
It gives following.
[root@allweb root]# rpm -e /var/lib/mysql
error: package /var/lib/mysql is not installed

[root@hallweb root]# rpm -e MySQL-server-4.0.16-0.i386.rpm
error: package MySQL-server-4.0.16-0.i386.rpm is not installed
[root@allweb root]# rpm -e MySQL-client-4.0.16-0.i386.rpm
error: package MySQL-client-4.0.16-0.i386.rpm is not installed
[root@allweb root]# rpm -i MySQL-server-4.0.16-0.i386.rpm
warning: MySQL-server-4.0.16-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
package MySQL-server-4.0.16-0 is already installed
[root@allweb root]# rpm -i MySQL-client-4.0.16-0.i386.rpm
warning: MySQL-client-4.0.16-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
package MySQL-client-4.0.16-0 is already installed
[root@allweb root]# /etc/init.d/mysql restart
No mysqld pid file found. Looked for /var/lib/mysql/shastrihallweb.pid.
[root@allweb root]# Starting mysqld daemon with databases from /var/lib/mysql
031219 22:38:14 mysqld ended

Since I could not Uninstall and tried to reinstall. But didn't worked out.

Then tried as follows :

First I moved mysql by mv /var/lib/mysql /var/lib/mysql_old
Then tried "mysql_install_db"

[root@allweb root]# mysql_install_db
Installing all prepared tables
031219 22:40:56 /usr/sbin/mysqld: Shutdown Complete

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h shastrihallweb password 'new-password'
See the manual for more instructions.
NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!
You can start the MySQL daemon with:
cd / ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
[root@shastrihallweb root]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@allweb root]# mysqld
031219 22:41:58 Can't start server: Bind on TCP/IP port: Address already in use
031219 22:41:58 Do you already have another mysqld server running on port: 3306 ?
031219 22:41:58 Aborting
031219 22:41:58 mysqld: Shutdown Complete

I tried to stop running mysql as follows:
[root@allweb root]# /var/lib/mysql stop
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I tried to restart as follows ;
[root@allweb mysql]# mysql restart
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

It's confusing for me.
Please guide me step by step to use mysql in this case. I tried to go through documentation but bit difficult to understand for newbe like me.

Thanks for support.
barney is offline   Reply With Quote
Old 10-31-2007, 11:48 AM   #3
bettytech
Junior Member
 
Join Date: Oct 2007
Posts: 3
bettytech is on a distinguished road
Default

This will help you the question 'How to uninstall MySQL
If you want to save your exisiting databases then goto 'C:\mysql\data\' and copy all the sub-folders in there that you want to keep, and paste them into a temporary location. Once your new installation is up and running, you can copy them back into 'C:\mysql\data\' ready for use. Note that this is not exactly the same as the 'upgrade MySQL' method on the mysql website, but works for me.
Whether you have saved your old databases or not, the next step in removing MySQL is then to delete the folder 'C:\mysql\' and all its containing sub-folders. Then , to remove the service, goto a DOS box and type 'mysqladmin -uroot -p shutdown' , type your master password if it asks for it. Type in 'mysqld --remove' and this will uninstall and remove the service.
You are now safe to proceed to install your new version.
bettytech is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 06:58 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
WebmasterForums.NET - Webmaster Forums & Directory