SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    714
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need to upload site containing a database

    I have created a website with 5 pages, one of which is a
    gallery page. I have had the site running for a year now.
    My gallery page was a plain html one. Now I have created
    a gallery page containing photos from a database. I have
    links in my gallery page to the various categories of
    photos and also next previous links in the respective
    category pages. I also have an admin page where I can
    add, delete and edit categories and photos. I have tested
    my site on my local machine and it is working fine.

    Now I am in the process of uploading this gallery page to
    my host's server. I have a few doubts.

    1. Do I need to create a database by going to the
    phpadmin on the cpanel of my host? Can I just go to the
    phpadmin on my local server and then export the database?
    If I do that, will my database, the tables, their
    respective fields and the photos that are contained in the
    database get exported?

    2. Or do I create the database and the respective tables
    and their fields in the phpadmin section of the cpanel of
    my host and then do the exporting of the data from the
    local server? I tried doing this on the server's phpadmin
    but found that the name of the database got changed e.g
    the name of my database was photogallery. When I went to my server's phpadmin on the cpanel, I had to give a user
    name and the name of the database that got created is now jppp_photogallery (I had given my user name as jppp). So, now I will have to change the name of the database on my config.php file.

    3. When creating a database and the tables and their
    fields, what is the advantage of writing mysql statements?
    Can one just go to the phpadmin section of the local
    server and enter the respective text fields that are
    readily available?

    What is the best way to have the database working on my
    host's server?

    I hope I am posting in the right forum. If I am not, I would request any moderator to move it to the right forum.

  2. #2
    SitePoint Zealot Cassidy's Avatar
    Join Date
    Mar 2009
    Location
    Texas
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should work ok if you are using phpMyAdmin, you need to adjust the config files of your website to match the "jppp_photogallery" name of the database.

    Also to import the ".sql" file you will need to edit some lines at the beginning:

    Code:
    -- phpMyAdmin SQL Dump
    -- version 2.11.9.4
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Mar 24, 2009 at 11:44 AM
    -- Server version: 5.0.67
    -- PHP Version: 5.2.6
    
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    
    
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    
    --
    -- Database: `jppp_photogallery`
    --
    I included the header from one of my recent dumps and adjusted the appropriate line per your post.
    Cassidy
    Income Mobility Make Your Income Upwardly Mobile
    WEB HOST with unlimited domains, Bandwidth, Disk Space, MYSQL
    $25 first year limited time offer Jiffy Hosting

  3. #3
    SitePoint Zealot RogueScripts's Avatar
    Join Date
    Feb 2009
    Location
    California
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are some good free tutorial videos on youtube that show you how to use phpmyadmin for mysql database (and tutorial videos for every other kind of database you can think of). Just go to youtube and seach for "How to use mysql" "How to use phpmyadmin" and phrases like that.
    Game Website Builder - Start Your Own Money Making Game Website
    Blogging For Money - Learn Profit Blogging
    Web Traffic Academy - Learn How To Get More Web Traffic

  4. #4
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    check some tutorials there is many tutorias about how to startup first database website

  5. #5
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1 . you can export throung Myphpadmin
    2. import with file.sql tyou database in you new site.

  6. #6
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    714
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to all of you. I had some personal issues and could not pursue this topic for quite some time and I am coming back to this thread after more than a month. For the past 2 weeks or so, I have been googling a lot and trying to see what I could do.

    I made some sample databases and tried to export them from the local host to my webhost’s server. But I have failed miserably and am finally coming to the forum again for help.

    Cassidy, how does one go to the config file? I spent a lot of time googling this but failed to see the config file showing what you have shown in your thread. Can you guide me on this? I have not succeeded in understanding sql dump either.

    After checking out some tutorials, I tried importing a database that I had created as a sample. I had created a database which had a table with a few fields and I had inserted some data into the tables (All this was done on my local machine). I then went to phpmyadmin and then exported the database as per the instructions of a tutorial. Then I went to the phpadmin of my webhost’s cpanel. I am using the services of hostgator.
    I tried importing the files. I followed all the instructions given in the tutorial, but get the message, error 1044: Access denied for jppp@localhost to database 'gallery'. Now jppp is my user name and the name of the sample database that I created is gallery. I tried going to the privileges section and tried to make necessary changes but have not succeeded. Can any of you help me please?



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
  •