Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux: location of mysql.sock

Status
Not open for further replies.
Feb 14, 2002
88
JP
Greetings:
(Title may be deceptive -- please read to the end)

I'm having some issues installing MySQL 4.0 on my Linux machine at work. At home, it was no problem (Redhat 9). But here (Redhat 8) is a different story.

I'm installing from the tarball, and followed the instructions to a T. I linked /usr/local/mysql to the full path, and all that jazz. I ran scripts/mysql_install_db and whatnot, and then bin/mysqladmin -u root password 'mypassword'. However, once I get the daemon running, and try to connect, it gives me an error.

It says it can't connect via /var/lib/mysql/mysql.sock which should be a given since the file is in /tmp.
As far as I can tell, I set the root password properly. So, I'm wondering if the socket being in /tmp is a problem. Also worth nothing is that mysql/data has 777 permissions and is owned by mysql.
This is driving me nuts. I see a lot of examples of this problem on the net... but no real clear answer.

Any help is appreciated.
-----------------
UPDATE:

Dang, of course I figured it out after writing all of this. This worked:
mysql --socket=/tmp/mysql.sock -u root -p

But, in an effort not to waste my energy typing, how about another question:
Anyway to change the default socket value? I see in the docs there's the
configure script, but this seems to be pre-installation.

Finally, I logged in once as root, and granted priviledges on a new DB that I created. I can see it with "SHOW DATABASES;"
When I log in as another non-root user, I cannot see (and obviously cannot access) this database.

Any ideas there?
 
Well, I got the privileges thing sorted out. I guess I didn't grant them properly the first time. Still wonering about the sock problem though.
 
Normally, the socket location is set in the my.cnf file in /etc
MySQL will look for the socket at that location.
If you now stop and start the database, do you get the error?
 
Normally, the socket location is set in the my.cnf file in /etc
MySQL will look for the socket at that location.
You can change this to the actual location of the socket file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top