Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    CPW
    CPW is offline
    Member
    Join Date
    Sep 2006
    Posts
    53
    Member #
    13935
    I would like to create a MySQL file for my website and place it in a folder. I would then like to connect to that database in my PHP code. I understand how to connect to a database set up on the server, but I would like to use a separate file that I can see. Is there a way to do this? I'm downloading a program right now that should be able to make the database file, but how would I connect to that file in my code, since I would need to enter a path?

    The reason I'm doing this is mainly so I can see a visual of my database with the program I'm downloading. I don't like working with databases I can't see the structure of. I like it better when I can see all of the tables and stuff, like in Microsoft Access.

    Thanks.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    No, you can't, and for good reason. Access has just trained you to think about databases a certain (wrong) way. The idea of a database is to abstract the actual method of storage away from you so you only define the structure of the data, not how the bytes are to be stored.

    You can browse your databases easily using free tools such as phpMyAdmin (http://www.phpmyadmin.net/). At work and home, I use a tool called SQL Manager 2005 (both the PostgreSQL and MySQL editions): http://www.sqlmanager.net/ .
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Why would you need the file, anyway? If you want to simply copy your database, you can just do an "export", which is pretty much breaking up the data in the DB back to a "creation" script. Run the export result to get the database back exactly like how it was.

    And most hosting services provide phpmyadmin.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  5. #4
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    Or if you want, you can type describe tablename; in the MySQL console. That'll show you the table structure without having to export anything. That is, unless you're against working with the console, as some people are. It is pretty archaic, huh?

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Oh, I wouldn't call the console archaic in the sense that it's old-fashioned and rarely used. It's a different tool, one that comes in very useful in certain circumstances (like when you need to run a bunch of commands) and gets in the way in others (if you want to draw a 3d model).

  7. #6
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    Not that I have anything against it myself, but yes, as you said, there are often other tools to use. I've just heard too many hotshots complaining about how "tacky" it is.

  8. #7
    CPW
    CPW is offline
    Member
    Join Date
    Sep 2006
    Posts
    53
    Member #
    13935
    Thanks for the links and info. I didn't necessarily need the db in a separate file, but I didn't realize there was a way to view the structure if it wasn't. I will take at look at those webpages and see if they have what I need. Thanks.

  9. #8
    CPW
    CPW is offline
    Member
    Join Date
    Sep 2006
    Posts
    53
    Member #
    13935
    Alright, I downloaded phpMyAdmin and it is exactly what I need. Thanks for the link. I also downloaded SQL Manager. However, when trying to set it up so I can work with a pre-existing database, it doesn't work. I gave it my host, username, and password, and then clicked next. The pull-down database list was empty and when I clicked on it I got an error that said: "Can't obtain database list from server. Cannot load dynamic library libmysql.dll". I know I gave it the right information because it works with phpMyAdmin, so what is wrong? I would like to try it out, but I can't get it to work. Any suggestions on how to make it work? Thanks.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:13 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com