Results 1 to 5 of 5

Thread: finding mysql dir

  1. #1
    Associate
    Join Date
    Apr 2008
    Posts
    11

    finding mysql dir

    how can i find mysql dir? if i install mysql using yum

  2. #2
    well, there's probably a better way... but you could always search for it...

    find / -name mysql -type d

    searches starting at / for something named mysql of type directory
    63,000 bugs in the code, 63,000 bugs,
    ya get 1 whacked with a service pack,
    now there's 63,005 bugs in the code!!

  3. #3
    Associate
    Join Date
    Apr 2008
    Posts
    11
    Quote Originally Posted by countach44 View Post
    well, there's probably a better way... but you could always search for it...

    find / -name mysql -type d

    searches starting at / for something named mysql of type directory
    Code:
    [root@linux2 ~]# find / -name mysql -type d
    /usr/share/mysql
    /usr/include/mysql
    /usr/lib/mysql
    /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/DBD/mysql
    /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql
    /var/lib/mysql
    /var/lib/mysql/mysql
    which one is the home directory in my case ? and what does that -type d mean ?

  4. #4
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811
    "-type d" means search for anything which is a directory matching the "-name mysql"
    By the way, searching for the "file" mysql, is a bit deviant, since mysql is the executable which invokes communication with the database mysql has created on your system, which in fact is a structure of its own created as a single file/library within your filesystem.
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  5. #5
    If you're looking for the homedir for the mysql user, you can try:

    cat /etc/passwd | grep mysql | awk -F: '{print $6}';

    cat will output /etc/passwd to stdout, grep takes only lines with mysql in them and awk splits the string (based on ':' ) and prints the 6th item.
    63,000 bugs in the code, 63,000 bugs,
    ya get 1 whacked with a service pack,
    now there's 63,005 bugs in the code!!

Similar Threads

  1. MySQL worm for Windows halted
    By genesis in forum Windows - General Topics
    Replies: 0
    Last Post: 01-28-2005, 09:53 PM
  2. Hopefully quick q on MySQL
    By Schotty in forum Linux - Software, Applications & Programming
    Replies: 9
    Last Post: 02-25-2003, 12:16 PM
  3. MySQL Error msgs
    By gmoreno in forum Announcements and Suggestions
    Replies: 4
    Last Post: 01-31-2003, 09:01 PM
  4. MySQL Admin GUI
    By mcdougrs in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 10-25-2002, 08:45 PM
  5. mysql installation instructions & permissions
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 02-06-2002, 10:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •