OOOPPSS!! Help with MYSQL!!

Place to discuss Fedora and/or Red Hat

OOOPPSS!! Help with MYSQL!!

Postby ZiaTioN » Wed Apr 23, 2003 12:20 am

Ok I was having problem with MySQL and for some stupid reason i accidentally deleted /etc/init.d/mysql.

Now I am trying to temove the rpm by rpm -e "package name" and it erros becausr that file is missing.
Is there anything I can do to get this piece of crap off m,y system without reformatting the whole drive??

Maybe if someone had the mysql app from the version 4.0.12 server rpm and they sent it to me i could sub it in long enough to remove the rpm??

Pleas help!!!!
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Wed Apr 23, 2003 1:01 am

No, you don't have to reformat/reinstall. Did you try "--noscripts" and/or "--nodeps" and/or "--force" params? I don't believe I've ever seen a package not uninstall because of a missing file. It may complain that a file is missing but usually it will only not uninstall if something else depends on it.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Wed Apr 23, 2003 7:50 am

Hmm no I hadnt tried those options but still no luck for some reason.

I tried rpm --noscripts --nopeds --force "Package name" and I got an eror saying the "--nopeds" was an unrecognized option.

So I took that out and used the other 2 and got an error saying only instillations, upgrading, rmsource and rmspec can be forced.

So I took the "--force" out and tried just "--noscripts" and I got this error: "script disabling options may only be specified during installation".

Weird huh? I am out of ideas!!!!
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Wed Apr 23, 2003 7:57 am

Can you give me the "exact" message that is given when you just do the "rpm -e packagename"? And if it really is failing to remove because it is screaming about a missing /etc/init.d/mysqld file then give it one:

# touch /etc/init.d/mysqld

I just can't imagine that is the sole reason for it not uninstalling.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Calum » Wed Apr 23, 2003 9:33 am

ZiaTioN wrote:I tried rpm --noscripts --nopeds --force "Package name" and I got an eror saying the "--nopeds" was an unrecognized option.
i think i can hazard a guess why that was the case, you should have been using --nodeps instead of --nopeds. "nodeps" is short for "do not check dependencies". "nopeds" is short for, well probably "do not check for pedals" or something. try reading "man rpm" to find out some other useful options you might want to try.

also, might i say that "i got an eror" [sic] is not that helpful. the exact error is usually desirable as void main says, rather than just the general gist of it.
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Void Main » Wed Apr 23, 2003 9:48 am

Heh heh, I didn't even notice the "nopeds". I wouldn't suggest using "--nodeps" in any case, but I would opt for the proper way. Breaking dependencies is bad, remove the dependent packages first or remove them all at once in the same command. Or install "apt" and do "apt-get remove pkgname" and it will automatically select the packages that depend on it for removal and prompt you if you really want to follow through with the procedure.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Wed Apr 23, 2003 2:15 pm

Yeah the --nopeds was a typo on my last post. I actually did use the correct option and got that error. As far as checking out the man pages I already have and none are usefull, even the ones that were mentioned in this thread but I thought I would try.

I have an idea what I can do to maybe jolt it into removing itself. I am just going to try to force an install on top of the existing package and then remove.

Oh and by the way I have tried just 'touching" a fake mysqld file into /etc/init.d. Needles to say it did not work.

Thanx for the help guys...
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Wed Apr 23, 2003 3:45 pm

You still have not copy/pasted the exact error message. I am sure I can help if you do.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Wed Apr 23, 2003 5:16 pm

Yeah I am not at home right now but I will throw the error message up when I get home.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Wed Apr 23, 2003 5:35 pm

Actually I believe I have your answer. I just deleted my /etc/rc.d/init.d/mysqld and then tried to remove the mysql-server package and got this:

# rpm -e mysql-server
Code: Select all
error reading information on service mysqld: No such file or directory
error: %preun(mysql-server-3.23.54a-11) scriptlet failed, exit status 1


Now here's the command that will skip the %preun section of the RPM spec and remove the RPM:


# rpm -e mysql-server --nopreun


The "--nopreun" param is listed in the man page.

Now, just out of curiosity if you want to see what commands were skipped by using the "--nopreun" param you can look at the scriptlets by doing this:

# rpm -q mysql-server --scripts
Code: Select all
preinstall scriptlet (using /bin/sh):
/usr/sbin/useradd -M -o -r -d /var/lib/mysql -s /bin/bash \
        -c "MySQL Server" -u 27 mysql > /dev/null 2>&1 || :
postinstall scriptlet (using /bin/sh):
if [ $1 = 1 ]; then
    /sbin/chkconfig --add mysqld
fi
/bin/chmod 0755 /var/lib/mysql
/bin/touch /var/log/mysqld.log
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
    /sbin/chkconfig --del mysqld
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
    /sbin/service mysqld condrestart >/dev/null 2>&1 || :
fi


And the one piece of script we are interested in is under the "preuninstall scriptlet":

Code: Select all
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
    /sbin/chkconfig --del mysqld
fi


So basically we just skipped the system command "chkconfig --del mysql" which would have removed the mysql scripts from /etc/rc.d/init.d and /etc/rc.d/rc?.d directories. You can do that part manually if you want and the entire removal will be complete:

# rm /etc/rc.d/init.d/mysqld
# rm /etc/rc.d/rc?.d/*mysqld
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Wed Apr 23, 2003 8:18 pm

Cool!! Thanx man that did it. Some good info to know also.

However now I have a new problem. I re-installed the MySQL and tried to issue the command:

mysqladmin -u root password "my_pass"

to change the root password and I got the error:

"mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: No)'

Maybe there is some preconfig that needs to be done manually??
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Wed Apr 23, 2003 8:43 pm

If your mysql root user already has a password you are probably going to have to add the "-p" option. As a side note there is one thing that I am sort of a whimp about and that is configuring database users and database permissions, I usually do this through webmin. One of the few (if not the only) thing that I use a graphical tool to configure something, not because I have to just because I do it so infrequently I forget.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Wed Apr 23, 2003 9:03 pm

Yeah I just installed the MySQL so I do not know how the root user already has a pass because I have not given one. Unless there is a default or something.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby ZiaTioN » Wed Apr 23, 2003 10:06 pm

Ok I tried from my actual box and not ssh'd in from my other box and used a user name of ZiaTioN which is a normal user on my box and it connected by ujust issueing the command "mysql".

I still can not get my BBS to install all the way though. I am messing around with phpBB2.0.4 and I cannot get it to connect because the server will not accept connections from 192.168.0.4 is what it says. Funny becauser that is the network IP of the box that is running the MySQL server. So it cannot connect to itself?

I am looking into adding permissions and such but am having some trouble. Did you have to do any of this with this BBS?? Do I need to create a data base file before I run the install??
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Wed Apr 23, 2003 10:29 pm

This BBS is also phpBB 2.0.4. It was simple to install, just use "localhost" in the setup page for the database server name.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Next

Return to Fedora/Red Hat

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron