View Full Version : Complete reinstall of mysql help
szim90
January 3rd, 2007, 11:47 PM
Hello.
I apologize if this is stupid question, but I am new to mysql and I have not been able to find any answers.
I accidentally messed up my mysql installation (I corrupted the databases), and I tried to correct it by purging mysql-server and mysql-client, as well as emptying the /etc/mysql and /usr/share/mysql directories. Now, even after reinstalling the mysql-client, mysql-common, and mysql-server package, mysql will not start. How do I completely reinstall mysql, including all the default databases, and the /etc/mysql and /usr/share/mysql directories?
Thank you for any help.
Sean
moephan
January 4th, 2007, 01:36 AM
When you uninstalled, did you mark it for "complete removal"?
Cheers, Rick
szim90
January 4th, 2007, 12:02 PM
I used the following command:
apt-get remove --purge mysql-server mysql-client
I think that is the same as synaptic's comlete removal.
Also, I was able to get back by /usr/share/mysql files by reinstalling all the mysql libs, but I still am missing files in /etc/mysql. Here is the error message:
* Stopping MySQL database server mysqld [ ok ]
* /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz
grep: /etc/mysql/my.cnf: No such file or directory
* Starting MySQL database server mysqld [ ok ]
/etc/init.d/mysql: line 122: /etc/mysql/debian-start: No such file or directory
I tried reinstalling mysql-common, but that didn't help.
Sean
szim90
January 4th, 2007, 03:46 PM
I was able to fix the problem by purging and then reinstalling the mysql-common package. This recreated the files in /etc/mysql.
For future reference, if I corrupt the mysql databases again, what is the best way to reset the databases?
Sean
Brazen
January 5th, 2007, 10:44 AM
I was able to fix the problem by purging and then reinstalling the mysql-common package. This recreated the files in /etc/mysql.
For future reference, if I corrupt the mysql databases again, what is the best way to reset the databases?
Sean
Database files are kept in /var/lib/mysql so that is the directory that you needed to empty. That was probably done when you purged the mysql-common package.
szim90
January 15th, 2007, 12:08 AM
Okay. Thanks for the help Brazen.
Wim Sturkenboom
January 15th, 2007, 01:57 AM
From the mysql manual:
mysql_install_db
This script creates the MySQL database and initializes the grant tables with default privileges. It is usually executed only once, when first installing MySQL on a system. See Section 2.10.2, “Unix Post-Installation Procedures”.
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.