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. Finding a computer with dynamic IP
    By cloverm in forum Linux - Hardware, Networking & Security
    Replies: 10
    Last Post: 04-16-2004, 02:24 PM
  2. New User - Help finding Ext USB H/D
    By rrushing in forum Redhat / Fedora
    Replies: 10
    Last Post: 01-25-2004, 03:04 AM
  3. Finding Wordperfect on Corel CD
    By DaMasta in forum Linux - General Topics
    Replies: 4
    Last Post: 04-29-2002, 12:32 AM
  4. finding a friggin tab with sed or grep
    By morphman in forum Linux - Software, Applications & Programming
    Replies: 13
    Last Post: 04-27-2002, 06:31 AM
  5. Finding Problems
    By Ashcrow in forum Linux - Hardware, Networking & Security
    Replies: 11
    Last Post: 04-08-2002, 12:54 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
  •