LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-29-2001, 05:54 AM   #1
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Rep: Reputation: 0

I've made a mess of trying to solve a problem with MySQL on RedHat 7.0. I upgraded from 6.2 and now the MySQL database application is giving errors. Long story, all I want to know now is how to uninstall in Linux. I know how in Windows, but don't know what to do in Linux. I presume it's the same -- simply deleting the directory is a no-no?

Thanks

F
 
Old 05-29-2001, 09:18 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Linux has some std. locations where stuff *should* end up on install, like /etc for configs, /usr/lib for support libraries, /usr/include for header files.
If u didnt install from an RPM, and ure dead sure no one can help u fix it (what errors does it give?) I'd say u can safely delete the mysql dir, check /etc for possible config and check inetd.conf and/or firewall to remove the entry (if any).
 
Old 05-29-2001, 01:57 PM   #3
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Original Poster
Rep: Reputation: 0
Well, I've had my error problem out on a bunch of message boards for three days now and not one reply. I'd be very happy if you have an answer for me. I'm over my head here.

I'm a student at the local tech. Our class project was a "department website". My job was to implement a web-based database. The professor has kept an Access database for years -- high tech companies in the region, students check it out for job searches and resumes.

So I re-created it in MySQL on the Linux server in the teacher's office, using ftp and telnet from the computer lab. I wrote HTML and cgi's for students to access the info, and companies could submit their info to add to the database. Cool.

I installed RedHat 6.2, Publisher's Edition, that came with the textbook, on my home machine for study at home. Good practice environment, my home PC's are networked. OK, it was working fine, but I didn't finish everything before the end of term. I've been working on finishing things, and I regret now that I decided to upgrade to the RedHat 7.0 boxed set. I've had some things with 6.2 that made me want to upgrade, and I decided that as long as I saved out my files that mattered, on the WinC partition, I should be OK.

The earlier MySQL was 3.22.32, downloaded as binary and gunzipped to /usr/local/..... The upgrade gave me a newer MySQL as an RPM. When I went to use it, I got the error "Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock (111)" The sock file is there, and I also found one at /tmp. Both are 0 byte files.
I have been on the internet looking for clues, and there are about 2000 results from Yahoo referring to that error, but nothing anywhere that I can find that tells me how to go about correcting it.

I tried downloading the latest, 3.23.38, but no change. I installed that one next door, again under /usr/local. I don't know how to "switch over" or upgrade from 3.22 to 3.23.

It's curious, but once I solved the problems from upgrading the Apache (I had to figure out the config stuff), I can now use my little dummy website and it works. I can pretend to be a company, and I can submit my info, and I can see that info show up in the table, and I can use my web forms and delete companies from the table, all that stuff. So the cgi's can connect, but I can't run "mysql -u root -p" and not get the error. I also get the error with any mysqladmin command. But sometimes it objects that it can't connect from /tmp. I'm lost. I don't know much of anything about sockets. Maybe the sock file is OK, but something else is wrong somewhere?

And it could always be that I overlooked or forgot to do one thing in setting up MySQL after the upgrade? I had to re-configure Apache, but I can't think of what I might need to do to mysql to get it to work, other than what I've done.

The daemon show with ps -ax, too. So it seems there is a database in there, and a database engine is running, and it's functioning somehow, but I can't connect to it in the terminal window.

So that's where I'm at -- I thought I could nuke everything of mysql and reinstall from the binary I had before, and save out the database per se, and be back in business. But I didn't want to just blunder around uninstalling things.

Sorry if that's too much detail, but I hope there's a clue in there.

Thanks

F
 
Old 05-29-2001, 06:24 PM   #4
doodah
Member
 
Registered: Apr 2001
Location: Columbus,OH
Distribution: slackware
Posts: 122

Rep: Reputation: 15
i just reinstalled mysql this weekend. in my case mysql was not showing up as an rpm on my box, but i know it was installed as a rpm by mandrake.. but either way, just do a

$ rpm -qa | grep mysql

and remove the packages with

$rpm -e PACKAGENAME

this should remove the packages so you can install again.. if the mysql is not listed on the rpm list, do a..

$ whereis mysql

then delete all the dirs and files it lists... then reinstall mysql through the rpm.. that should work.. but i found out the hard way that when you first start mysql you need to run a couple commands in a SPECIFIC order.. i installed from source and i had to reinstall a second time because i guess i didnt start the server correctly the first time.. this is the docs on mysql.com, the install section...

http://www.mysql.com/doc/P/o/Post-installation.html

i hope this helps, no warranty with this help though. unSpawn just helped me with similar probs the other day.
 
Old 05-29-2001, 07:28 PM   #5
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks. I used what you guys suggested, and blew it all away and reinstalled with gunzip from the tarball of 3.23.38. It took some blundering around to find everything (if I missed anything it doesn't seem to matter) and some more after the reinstall, including trying to remember how to set the PATH correctly, but, Bingo! I'm back in business.

Thanks a lot!

F
 
Old 05-30-2001, 12:07 PM   #6
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Original Poster
Rep: Reputation: 0
Guess I'm not done. UnSpawn, doodah, you still there?

I went back to using MySQL for its real use -- my web interface with the company database. Of course, I have to compile cgi's. Something's wrong with the compiling.

I wrote a script that I can run with a simple command, to do the compiling and copying the compiled cgi to the cgi-bin. Here's the code for button.cgi:

gcc -L/usr/local/mysql/lib -I/usrlocal/mysql/include -o button.cgi button.c -lmygcc -lmysqlclient -lmystrings -lmysys

I'm a student, remember, so here's what I understand is going on. -L says where the libraries are to be found, -I says where the headers are for the includes. I see in man gcc that the linker will take the files specified and add lib to the front and .a to the end. That looks good, because I see in /usr/local/mysql/lib that there are files named libmygcc.a, libmysqlclient.a, etc.

And mysql.h is in the directory I'm compiling from, which I think is where I need it (it's also in /usr/local/mysql/include)

So it seems to me that the files it needs are there.

I get the error:

/usr/local/mysql/lib/mysqlclient.a(my_compress.o): in function 'my_uncompress': my_compress.o(.text+0x9a): undefined reference to 'uncompress'
/usr/local/mysql/lib/mysqlclient.a(my_compress.o): in function 'my_compress_alloc': my_compress.o(text+0x12a): undefined reference to 'compress'

So something is missing or I-don't-know-what. It's beyond me at this point.

Any ideas?
 
Old 05-30-2001, 02:22 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
soz. didnt see ure post. Im no codah, but try including zlib support.

*btw, if Doodah replies below, would u please be so kind & remove the loose "where are u?" post? Thnx!
 
Old 05-30-2001, 03:20 PM   #8
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Original Poster
Rep: Reputation: 0
Sorry, is that bad etiqette? I'm new. I tried to delete it and it didn't work. I hit edit/delete, and clicked the Delete box, and submitted, but it didn't kill it.

Sorry

F
 
Old 05-30-2001, 03:29 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Heh. no. its not against netiquette, its personal.
I just dont like billboards with my name on it...

Asking ppl directly can be a bypass around the knowledge of others, who might think they arent "invited" to post cuz it dont metion them, I for myself wouldnt want to rely on the posts of only 1 or two ppl...
 
Old 05-30-2001, 05:35 PM   #10
doodah
Member
 
Registered: Apr 2001
Location: Columbus,OH
Distribution: slackware
Posts: 122

Rep: Reputation: 15
Quote:
...but try including zlib support.
yeh you need the zlib for compress and uncompress... just add -lz to you gcc line.... that should get you a little closer

 
Old 05-30-2001, 09:07 PM   #11
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Original Poster
Rep: Reputation: 0
Aamazing! Adding -lz worked!

You're on a winning streak. Can you help again? I can only figure the gods want me to learn a lot on this trip.

A number of times, but not every time, I've got the old error saying can't connect through socket /tmp/mysql.sock. Sometimes I look and -- presto! -- the file is gone from /tmp. This has happened at least 3 times now. Lucky I keep a spare copy in my /SafeKeeping directory. I copy it back in, and MySQL works again.

And several times the daemon has not started, and has not given me a clue at login unless I run ps -ax.

Also, if I invoke it directly

/usr/local/mysql/bin/safe_mysqld &

I get an error -- /usr/local/mysql/libexec/mysqld doesn't exist or is not executable.

What can that mean? There is no /libexec subdirectory.

And, I'm a bit confused. What is the standard, old reliable way of starting the daemon at login? I'm a student, and only playing with things here at home, so I always just log in as root anyway.

I only got shown once in class how to put a command in /root/.bash_profile. It never gave any trouble, so I long ago fuzzed out the details. The two things I find in the book are the above, and

/usr/local/mysql/support-files/mysql.server start

Is mysql.server the same daemon as mysqld?

Thanks again, you guys have helped so much, and after a couple of days of not one reply to my posts.

F
 
Old 05-30-2001, 10:49 PM   #12
doodah
Member
 
Registered: Apr 2001
Location: Columbus,OH
Distribution: slackware
Posts: 122

Rep: Reputation: 15
ok first look at it this way

mysqld - binary file
safe_mysqld - script
mysql.server - script
-----------------------------
they all do the same thing... mysqld is the daemon, it runs the show... the other two just make starting it easier.. safe_mysqld is a script that calls mysqld and passes in args for you.. its there to pass in the static args... safe_mysqld CANNOT read a config file, so it can only have args passed in manually.. so thats why we have mysql.server to do that... mysql.server will look for the /etc/my.cnf file and parse the optional arguments(if they are there).. if its not there, mysql.server has some of the default args hardcoded into the script from when you installed mysql... mysql.server then calls safe_mysqld with whatever args it finds, and safe_mysqld then calls mysqld with whatever args..

to get it to load at startup, well qouting the mysql.server file....
Quote:
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/S01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.
and the problem with the socket is probably because you have been trying to start up the server in all these different ways and you may be sending the socket file to a different dir sometimes.. thats just a guess....

[Edited by doodah on 05-31-2001 at 01:20 AM]
 
Old 05-31-2001, 06:27 AM   #13
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks. This is a lot of stuff I didn't get in class. At the pace we had to go, it's like teaching a kid to drive in a parking lot - here's the gas, here's the brake, here's the wheel. Then you're out on your own and the car dies - what do you do. This thread is getting under the hood, at least a bit. I follow what you're saying about the daemon and scripts. I read safe_mysqld and mysql.server, and I see basically what they're up to, though I didn't study them in detail.

I don't find a my.cnf file anywhere. There are 4 files in /support-files, my-huge.cnf, my-large.cnf, my-medium.cnf, and my-small.cnf. Reading them, it seems they are .cnf files for various sizes of memory. With 256 on my machine, I would be looking at my-medium.cnf, I figure.

They say I can copy the file to /etc/mf.cnf to set global options, or mysql-data-dir/my.cnf (I take that to mean the directory /usr/local/mysql/data in my case) to set server-specific opitons, or ~/my.cnf to set user-specific options. The "~" means what?

In the medium file it does set the socket to be /tmp/mysql.sock.

This morning when I logged in, once again the sock was gone from /tmp.

I've been starting the daemon the way we did in class months ago, and I vaguely remember the teacher saying that a professional setup would start it through some means having to do with the actual boot process, which I think you're telling me, with init.d. We used /root/.bash_profile to put in a line to run the script. That was months ago, and I don't recall whether it was with safe_mysqld or mysql.server, so I've been playing around with both. But it's maddening because it doesn't fail or give problems consistently, or at least that I can keep track of. There's so much up in the air here and so many things I'm fiddling with. Sometimes at login I get the message that the daemon started and then ended, but ps -ax show the daemon there. That kind of thing.

And I don't know how to link files. Can you explain?

 
Old 05-31-2001, 06:47 AM   #14
felecha
LQ Newbie
 
Registered: May 2001
Posts: 20

Original Poster
Rep: Reputation: 0
I feel like the kid who lets out the clutch and nothing happens, and then someone says, well, you gotta put it in gear first before you let out the clutch.

I tried a line in .bash_profile

cp /temp/mysql.sock /tmp/mysql.sock

so every time I login it would copy my extra mysql.sock into the right place, /tmp/mysql.sock. But it says

reading /temp/mysql.sock invalid argument

what? the cp command is so simple. How can I be screwing up?

And sometimes I look after login, and it did in fact get copied in.

Just now I'm in one of those pickles where it says it can't connect through socket /tmp/mysql.sock, and I see the daemon is running (it seems to give the same error if the daemon is not running), and the sock is there, so why this??

Sigh....

F
 
Old 05-31-2001, 09:37 AM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
The tilde (~) means "ure home dir" aka $HOME (if thats set).

Jeremy noted (over in the general forum) my.cnf sposed to be in /etc, which makes sense, cuz thats where all the config should be.

About the disappearing socket I dont know, Ive got msql2 overhere, and on daemon start it creates a socket in /dev (whic I think is the best place for em).
Could be a cronjob like tmpwatch clearing out stuff from temp on ure box?..

I fully agree with Doodah the SYSV way is the way to go for starting/stopping scripts, I couldnt see any other way make more sense.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can we uninstall linux nagu_linux Linux - Newbie 2 12-26-2004 01:22 AM
how do I uninstall linux lisbet Linux - Software 11 11-08-2004 09:49 PM
Source uninstall with 'make uninstall' HOWTO! Creeps Linux - Newbie 6 09-14-2004 12:03 PM
Uninstall Linux Liquid_Snake Linux - Software 7 07-10-2003 10:51 PM
How do you uninstall Linux? Typhonian Linux - General 4 04-12-2003 04:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration