Results 1 to 4 of 4
  1. #1
    sayan751 is offline Member
    Join Date
    Feb 2009
    Posts
    29
    Rep Power
    0

    Default How to Change MySQL Database Location

    i am using mysql5.3. All databases created are stored in a default system defined directory.

    Now my query is that is it possible to change that default database location?

    If yes then how?

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    For the entire server data.
    MySQL :: MySQL 5.1 Reference Manual :: 2.1.5 Installation Layouts
    For the "datadir" option
    MySQL :: MySQL 5.1 Reference Manual :: 5.6 Running Multiple MySQL Servers on the Same Machine
    for the "datadir" option
    MySQL :: MySQL 5.1 Reference Manual :: 5.1.2 Server Command Options
    for the "datadir" option without having to enter it at the command line
    MySQL :: MySQL 5.1 Reference Manual :: 4.2.3.2 Using Option Files

    It is always beneficial to read the manual.
    Last edited by masijade; 02-26-2009 at 11:55 AM.

  3. #3
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    Yes you can change it. Usually, the DB will only be indirectly referenced from your application. you can keep your application, change your reference (the jndi/persistence xml file) and then you can just copy and past your database to the desired location.

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by globaldelegation View Post
    Yes you can change it. Usually, the DB will only be indirectly referenced from your application. you can keep your application, change your reference (the jndi/persistence xml file) and then you can just copy and past your database to the desired location.
    This is not what he talking about though. As a matter of fact, what he is talking about has absolutely nothing to do with Java. It has to do with the physical installation and configuration of the DB itself.

Similar Threads

  1. Replies: 2
    Last Post: 02-11-2009, 04:43 AM
  2. database with mysql using the netbeans 6.0
    By kwesiaryee in forum New To Java
    Replies: 2
    Last Post: 05-02-2008, 04:27 AM
  3. MySQL Database and Java
    By shaggymac in forum Advanced Java
    Replies: 1
    Last Post: 05-01-2008, 09:01 PM
  4. problem in connecting to mysql database
    By nancyv in forum Java Servlet
    Replies: 6
    Last Post: 04-02-2008, 11:33 AM
  5. connecting to mysql database
    By javagal in forum NetBeans
    Replies: 2
    Last Post: 08-04-2007, 12:36 PM

Posting Permissions

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