Find the answer to your Linux question:
Results 1 to 7 of 7
I am dual booting Windows 2000 Professional and Fedora Core 4. On Windows I am running Miscrosoft IIS, PHP 4.3.9 and MySQL Server 4.1 On Fedora I am running KDE ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2005
    Posts
    4

    Linux/Windows MySQL data share


    I am dual booting Windows 2000 Professional and Fedora Core 4.
    On Windows I am running Miscrosoft IIS, PHP 4.3.9 and MySQL Server 4.1
    On Fedora I am running KDE 3.4, Apache, PHP 4.3.9 and MySQL 4.1

    I wrote a small php script that saves small amounts of text data on my mysql server.
    I wanted to be able to access this data from both windows and fedora. In windows I made sure my installation was in a fat32 directory on a secondary drive. I mounted that drive to /mnt/D.

    I then ran
    ln -s /mnt/D/MySQL/data/cimdat /var/lib/MySQL/cimdat

    When I open the script in fireFox via:
    http://127.0.0.1/cimdata/index.php

    I get no problems, my data comes up fine!

    when I try to update or add any data I get the error that the table has been opened as read only.

    I opened my file manager, navigated to /var/lib/MySQL right clicked on cimdata and selected properties, open the permissions tab, all my permissioins are set to read & write.

    I tried again to update data and the table is still opening as read only.
    The script works fine on windows. so I am wondering if my symlink needs to be set up differently or if there is another way to share MySQL data.

    Thanks in advance guys,
    Tobias

  2. #2
    Linux User
    Join Date
    Feb 2005
    Posts
    290
    run the following in shell mode and paste us the result:

    Code:
    mount

  3. #3
    Just Joined!
    Join Date
    Jun 2005
    Posts
    4
    Here is the output from running mount

    /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
    /dev/proc on /proc type proc (rw)
    /dev/sys on /sys type sysfs (rw)
    /dev/devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    /dev/hda3 on /boot type ext3 (rw)
    /dev/shm on /dev/shm type tmpfs (rw)
    /dev/hda1 on /mnt/C type ntfs (rw)
    /dev/hda2 on /winswap type vfat (rw)
    /dev/hdc1 on /mnt/D type vfat (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    automount(pid2066) on /misc type autofs (rw,fd=4,pgrp=2066,minproto=2,maxproto=4)
    automount(pid2115) on /net type autofs (rw,fd=4,pgrp=2115,minproto=2,maxproto=4)

  4. #4
    Just Joined!
    Join Date
    Jun 2005
    Posts
    4
    I booted to windows and then reset back to Fedora.
    I looked at my file permissions again and now they are set to
    Owner: RW
    Group: R
    Other: R
    Is executable

    I opened a terminal in /mnt/D/MySQL/data/cimdata and ran
    chmod 777 cimtable.myd

    it seemed to run just fine but when you open the graphical permissions dialog they don't change.

    Is it possible to set unix style file permissions on a file stored on a fat32 file system?
    Is it possible to set up some sort of permission map that windows ignores and lets fedora set unix style permissions?

    Or we could address this from an end result point of view. Does any one have any other idea how I could share MySQL data between windows and linux?

  5. #5
    Linux User
    Join Date
    Feb 2005
    Posts
    290
    all right, i tried on a fat32. Outcome:
    1) owner is set to root, group owner to root as well, and it can't be changed.
    2) chmod 777: remain rwxr-xr-x (755). As mysqld runs as mysql user, it can only read, but not write (and that's what rwxr-xr-x means)
    3) i've tried mount -t smbfs, same outcome.

    easy speaking, AFAIK (yeap, as far as i know) , you can't have your mysql data file in fat/smb partition. either do a automated or manual copy over (that would be crazy if the file is extremely big) to the FAT everytime you reboot the PC, or give up......

    good luck.

  6. #6
    Just Joined!
    Join Date
    Jun 2005
    Posts
    4
    I guess I will just do any data entry or manipulation while I am running windows, and only view it while running linux. The other solution, that I hope to accomplish soon, is to migrate completely to linux; which completely does away with my current problem.

    Thank you very much for your advice and assistance with my problem; I greatly appreciate it.

  7. #7
    Just Joined!
    Join Date
    Oct 2005
    Posts
    1
    Quote Originally Posted by HighNoonRiders
    I guess I will just do any data entry or manipulation while I am running windows, and only view it while running linux. The other solution, that I hope to accomplish soon, is to migrate completely to linux; which completely does away with my current problem.

    Thank you very much for your advice and assistance with my problem; I greatly appreciate it.
    After a while (half a day) I found the solution, er, half the solution. But I think that windows mysql version shouldn't pose hard problems.

    I am, like you, in need to have mysql data shared between windows and linux (fedora rc4 on vmware).

    The scenario:
    -win xp
    -linux fedora rc4
    -an external usb hard disk mapped j: with a folder named \mysql\data.
    -the folder named "data" is shared using a generic windows user (Group: Users) with name usershare, password goofy (just to write one down...)
    -permission properties in win (xp) for the folder "data" and subsequent files and folders are set to permit all modifications (read/write) to the user usershare
    -sharing for the folder "data" is set only to the user usershare, read/write
    -sharing name for the folder "data" is set in windows to "mysqldata"
    -linux has mysql server and client version 4.1.14-1.FC4.1
    -i emptied (backupped) /var/lib/mysql, remember it's owned by mysql.mysql
    -in linux i added a line in fstab:
    Code:
    //xppcname/mysqldata /var/lib/mysql smb rw,exec,nosuid,username=usershare,password=goofy,uid=mysql,gid=mysql,fmask=660,dmask=755
    (if you don't need to mount with fstab the mount command obviously follows accordingly)
    -After the mounting you can see all the files and the directories owned by mysql.mysql

    And i found the same errors you found plus that for the mysql.sock file, and other errors following my tries.

    -Given a particular error seen in /var/log/mysqld.log i decided to move the mysql.sock file into another location
    -I tweaked a bit with my.cnf file and this is now its content:

    Code:
    [client]
    socket=/var/run/mysqld/mysql.sock
    
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/run/mysqld/mysql.sock
    old_passwords=1
    
    [mysql.server]
    user=mysql
    basedir=/usr
    socket=/var/run/mysqld/mysql.sock
    
    [mysqld_safe]
    err-log=<<untouched>>
    pid-file=<<untouched>>
    socket=/var/run/mysqld/mysql.sock
    -Now, the magic. With all the permissions set correctly, as above, mysqld called within mysqld_safe strangely refuses to run. I say strange because taken the line from mysqld_safe, substituting the variables, and issuing the command by the command line, mysqld starts smooth...

    Open mysqld_safe with vi or whatever and go to the last rows, where mysqld is called.
    the lines (2 to change) start with
    1)
    Code:
    $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=...
    2)
    Code:
    eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=...
    they become
    1)
    Code:
    sudo -u mysql $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=...
    2)
    Code:
    eval "sudo -u mysql $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=...
    Move above the same file and find the block commented like this:
    Code:
    #
    # Second, try to find the data directory
    #
    Modify this line within the if
    1)
    Code:
    defaults="--defaults-extra-file=$DATADIR/my.cnf"
    like this
    1)
    Code:
    defaults="--defaults-extra-file=/etc/my.cnf"
    The file my.cnf isn't related at all (my conclusion) to the $DATADIR folder

    That's it.
    I run
    Code:
    service mysqld start

    and it happened, a very beautiful green OK into brackets... what a joy.

    Security is not a concern for me, so, be happy...

    The windows solution?
    The other half, but as I said before, I expect easier configuration (or, I hope so...)

    Bye!
    Maurizio

Posting Permissions

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