Hi
somehow i have trashed the mysql database to the extent that i cannot login or change the password and i have tried loads of things i have found on the net.
As i had nothing in the database and want now to install a program which requires it i want to be able to reset mysql to the state it was when i first installed Clear
Can someone please advise me on how to either delete the databases and config files so i can get it all back up again or maybe uninstalling mysql and reinstalling may help (although i have tried this and the database still remained the same)
Thanks
somehow i have trashed the mysql database to the extent that i cannot login or change the password and i have tried loads of things i have found on the net.
As i had nothing in the database and want now to install a program which requires it i want to be able to reset mysql to the state it was when i first installed Clear
Can someone please advise me on how to either delete the databases and config files so i can get it all back up again or maybe uninstalling mysql and reinstalling may help (although i have tried this and the database still remained the same)
Thanks
In Database
Share this post:
Responses (8)
-
Accepted Answer
*This is from one of my older posts from 5x but the same should still apply
Create a text file call it mysql-init copy it to your server
Add this code to the contents
UPDATE mysql.user SET Password=YOURPASSWORD GOES IN HERE('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
mysqld_safe --init-file=/home/me/mysql-init &
The server executes the contents of the file named by the --init-file option at startup, changing each root account password.
After the server has started successfully, delete /home/me/mysql-init.
(replace /home/me/ to your directory path to the mysql-init file)
This will flush out any stuffups also see http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html from the mysql 5.0 ref manual -
Accepted Answer
I just ran into the same problem and read through the post - seeing what you did to resolve yours. However, instead of deleting the /var/lib/mysql/mysql folder, I simply stopped the MySQL server (from the web interface), renamed the folder, and restarted it. The system recreated the database and prompted me to establish a password.
Thought I'd share, just in case somebody else ran into this problem. -
Accepted Answer
hi
Perhaps i could have been clearer but in the end i only manually deleted the contents of the /var/lib/mysql/mysql directory (actually i copied them to another dir just in case it didnt work)
now the mysql dir was empty mysql didnt think it had a database so then i ran
mysql_init_db
which recreated the database as though it was a first install.
Obviously this only helps if you dont need any of the data in the databases but that was fine for me.
As regards to uninstalling anything i ony tried that out after making a backup and it didnt work and you are right it's not a step to take lightly.
Hope this helps -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
Thanks for reply
I will give this a go but i will wait for a short while just in case anyone can help trashing the database first as this should be the easiest way.
as i see it if i can completely get rid of the database inc users etc then i can recreate it by using mysql_secure_installation to recreate the databases to a clean install enviroment
or at least i hope so
anyhow thanks again and looking forward to more suggestions -
Accepted Answer
Hi machmandp,
I am only learning about how this works and if you follow my steps, you do it on your own responsibility, because there are 2 MySQL engines running on your ClearOS box and one is used by the system so ...
Here's what I did:
Don't ask me why "app-mysql" is not listed ... :dry:# yum --enablerepo=* list app-mysql
Loading "kmod" plugin
Loading "protect-packages" plugin
Installed Packages
app-system-mysql.i386 5.1-20 installed
#
According to what I understand what Ben is talking about, if you want to "yum" uninstall the additional MySQL, you could try this:yum --enablerepo=base-extras remove app-mysql
Don't shoot the messenger, because I didn't test this and if it means that you have to do a clean install ... :blink: ... you better wait until someone confirms or denies this or prepare for the worst.
And in case that this worked (let us know please), you could do this to reinstall it:yum --enablerepo=base-extras install app-mysql
Otherwise I would not know, so good luck.
John

Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »