SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    625
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Unable to transfer database from one site to another

    hi all

    i am transferring database from one website to another.

    When ever a database is created, then a prefix is added to the database name.

    If my 1st website control panel loginid is vi555 then if i create a database the database name will be "vi555_db1".

    If my 2nd website control panel loginid is vi777 then if i create a database the database name will be "vi777_db1".

    The problem :
    I took backup of 1st website database from phpmyadmin and tried to insert into 2nd website database it shows me error

    Code:
    Error
    
    SQL query:
    
    --
    -- Database: `vi555_db1`
    --
    CREATE DATABASE IF NOT EXISTS `vi555_db1` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    
    MySQL said: Documentation
    #1044 - Access denied for user 'vi777'@'localhost' to database 'vi555_db1'
    i think the problem is with the prefix. It is not allowing me to insert database into 2nd website.

    Can anybody tell me the solution ?

    I want to transfer database "db1" with tables and data from 1st website to 2nd website database.

    vineet

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,339
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    open the dumped .sql file in a text editor, change the prefix on the CREATE DATABASE statement, save, and then run it again
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    625
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks r937

    Its now working fine.

    vineet

    Quote Originally Posted by r937 View Post
    open the dumped .sql file in a text editor, change the prefix on the CREATE DATABASE statement, save, and then run it again


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
  •