SitePoint Sponsor

User Tag List

Results 1 to 22 of 22

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How make MySQL run from externalharddrive ?

    Hi

    I installe MySQL on my externalharddrive. what shall I do in order to be able to use use the database on any PC that do not have MySQL server installed ? How can I start the MySQL service from any PC ? How can I create and start a new MySQL instance ? is there a way to make MySQL portable on any operating system without installing a new MySQL server on each system ? can I make an installer for the MySQL database ?

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i can answer your questions, but i'm suspicious you're trying something unorthodox when there's probably a much easier solution. can you explain why you want to do all of this?

  3. #3
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to use my program on any PC without installing the program on any pc.

    Now I was able to start the service using
    mysqld-nt
    from the external harddisk

    But I am not sure if this would work on any pc , since i don't have another pc to ckeck ?

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Download Microsoft Virtual PC and one of the XP virtual drive images they provide for free. You can use that to test your software on a 'new' PC.

  5. #5
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    Download Microsoft Virtual PC and one of the XP virtual drive images they provide for free. You can use that to test your software on a 'new' PC.
    I installed VP 2007 , but from where can I get the XP virtual drive image for free ? does that mean I can get free copy of any microsoft OS ?

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kmool View Post
    I installed VP 2007 , but from where can I get the XP virtual drive image for free ? does that mean I can get free copy of any microsoft OS ?
    No, only a few. They're meant for testing websites in IE6, IE7 and IE8 without having three separate computers, but it's an easy way to get a copy of Wndows XP or Vista to test anything on. The images expire after a few months so you can't use them as your primary operating system.

    http://www.microsoft.com/downloads/d...displaylang=en

    If you actually want to have a copy of any Microsoft OS they've ever made for testing software, like you're doing, you can buy an MSDN subscription.

  7. #7
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks to all of you guys . How can I know the current drive to read from ?
    for example , I am using a fixed drive now , F , how can this be adjusted to work on any drive name ( C, D , E etc )

    start F:\programs\bin\mysqld-nt --defaults-file=F:\programs\MySQL\my.ini
    Also how can I run java from the external drive ?

  8. #8
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What of using this tool to add everything ?
    http://googlesystem.blogspot.com/200...s-live-cd.html

    any idea ?

  9. #9
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i do this all the time from my flash drive. you don't have to install a service to do it, either. just use the --console option and start the mysqld program from a command line.

  10. #10
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by longneck View Post
    i do this all the time from my flash drive. you don't have to install a service to do it, either. just use the --console option and start the mysqld program from a command line.
    this seems to work with the database . I am using java program with the MySQL , so I want to check if everything is complete or I need to install a JVM on it ?

  11. #11
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    your command should look like this:
    Code:
    mysqld-nt --console --defaults-file=..\my.ini
    also make sure that you don't specify datadir and dir in your my.ini file since mysql always assumes the data directory is ..\data from where your mysqld.exe file is run from.

  12. #12
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by longneck View Post
    your command should look like this:
    Code:
    mysqld-nt --console --defaults-file=..\my.ini
    also make sure that you don't specify datadir and dir in your my.ini file since mysql always assumes the data directory is ..\data from where your mysqld.exe file is run from.

    thanks longneck

    I made a .bat file to start the MySQL and run the java program.

    start F:\programs\bin\mysqld-nt --defaults-file=F:\programs\MySQL\my.ini
    How can I change this code to place this .bat file , in programs folder ?


    start \bin\mysqld-nt --defaults-file=\MySQL\my.ini
    it didn't work ?

  13. #13
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found this code in the my.ini file
    #Path to installation directory. All paths are usually resolved relative to this.
    basedir="F:/programs/MySQL/"

    #Path to the database root
    datadir="F:/programs/MySQL/Data/"
    shall I remove them or make the ="" ?

  14. #14
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kmool View Post
    it didn't work ?
    because you didn't follow my example. you need to put a relative path, not an explicit path: --defaults-file=..\my.ini
    Quote Originally Posted by kmool View Post
    shall I remove them or make the ="" ?
    remove them entirely. since those are the default locations, you don't need them.

  15. #15
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked !

    I need another help please . Now I will place this bat file inside the bin directory of MySQL . How can I run a java program that is located in another upper directory ?

    I used

    java -classpath mysql-jdbc.jar; ..\mainframe
    But it says no class def found ?

  16. #16
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    windows live cd's take forever to boot up.

  17. #17
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    no idea. i'm not a java guy.

  18. #18
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have any idea how to start the server on mac ?

    thanks a lot

  19. #19
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    nope, not really. any advice i give you would come straight from the mysql manual.

  20. #20
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when I removed these

    #Path to installation directory. All paths are usually resolved relative to this.
    basedir="F:/programs/MySQL/"

    #Path to the database root
    datadir="F:/programs/MySQL/Data/"
    It selects by default the ones in the C: drive which is not the ones I need ?

  21. #21
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    you probably have a my.ini file in the root of your c: drive or somewhere in your windows folder. delete it.

    i also just recently read about another way to do this, but i haven't tested it:
    Code:
    #Path to installation directory. All paths are usually resolved relative to this.
    basedir="./"
    
    #Path to the database root
    datadir="./Data/"
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

  22. #22
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I searched my.ini in my computer but nothing was there ! I wonder from where it is reading this data ?

    I used the folders name without the drive and it seems it is working .
    thanks again.

    Is there any tutorial where can I read about this .\ and ..\ or ./ or ../ etc ?


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
  •