1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to pull database from Amazon Server without phpMyAdmin access?

Discussion in 'Databases' started by InvestInPixels, Dec 15, 2013.

  1. #1
    Hi there,

    My website is hosten on an amazon server and unfortunately I do not have access to the phpMyAdmin which was setup for the database.

    I do however have the Amazon server key and I'm sure I have the other details required to access it via Terminal.

    Is there a way to pull the database from my Amazon server via Terminal (or an internet browser).

    Thank you!
    Solved! View solution.
    InvestInPixels, Dec 15, 2013 IP
  2. #2
    Yes.
    if you have SSH access then access your server form their then connect to mySQL by issuing following command:
    > mysql -u yourusernamegoes here -p YourPasswordGoesHere

    once you login in to mySQL if you have access or else then you have to contact them to give you back up... but if you did then you dump the database from mySQL command to your server or in some external location by following command

    >mysql -u username -p databasename < path/example.sql

    the path is where you want your database file to be save

    regards
    khodem, Dec 25, 2013 IP
  3. InvestInPixels

    InvestInPixels Member

    Messages:
    496
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    45
    #3
    Thanks for the reply!

    I have SSH access but not sure of the username or password as it was setup by someone else.

    That being said, I can access the Amazon console via the browser (to see my instances etc). Not sure if I can grab my uploaded site files and database from there?

    Thanks!
    InvestInPixels, Jan 4, 2014 IP
  4. sahabcse

    sahabcse Active Member

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    90
    #4
    Use mysqldump command via terminal for taking the backup, for that you need db username and password.
    In Command Prompt type the following to create the dumpfile:

    mysqldump -h host -u user-p databaseName > dumpFile.sql

    If you don't know the password, try to reset the same using mysql-safe method else contact amazon support team for assistance.
    sahabcse, Jan 7, 2014 IP
  5. InvestInPixels

    InvestInPixels Member

    Messages:
    496
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    45
    #5
    A little updated.

    I got access to the Amazon EC2 server via Cyberduck. I'm able to see folders such as bin, boot, dev, etc, home, lib, root, swapfile and many more.

    Would this help me?
    InvestInPixels, Jan 14, 2014 IP
  6. InvestInPixels

    InvestInPixels Member

    Messages:
    496
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    45
    #6
    Success! I pulled the database.php file from the server and found out the details. The problem is, I don't know where to login to access the phpmyadmin or mysql server.

    Right, I found the mysql folder using a SFTP connection (logged in as ec2-user with my pem key). The problem is, I don't have the permissions to download the var/mysql/<mydatabase> folder. Not sure what to do next.
    Last edited: Jan 14, 2014
    InvestInPixels, Jan 14, 2014 IP
  7. PoPSiCLe

    PoPSiCLe Well-Known Member

    Messages:
    1,218
    Likes Received:
    109
    Best Answers:
    51
    Trophy Points:
    160
    #7
    normally, the phpmyadmin for the site would be phpmyadmin.domain.com or domain.com/phpmyadmin - I'm assuming neither of these work? You could try and see if you can find phpmyadmin installed somewhere on your server, or see (via the control panel, maybe?) if there's a link directly to it
    PoPSiCLe, Jan 31, 2014 IP
    InvestInPixels likes this.
  8. InvestInPixels

    InvestInPixels Member

    Messages:
    496
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    45
    #8
    Thanks for your reply, it's much appreciated. Luckily we managed to reboot the database and then access phpmyadmin (which was previously returning an error as the database was not live). So now everything is sorted!

    Cheers!
    InvestInPixels, Jan 31, 2014 IP