Results 1 to 8 of 8
  1. #1

    Exclamation Creating Database from a backup file onto cPanel?

    First of all, I am sorry if I posted this in a wrong section, I am not all to familiar with this forum's setup.

    Second I am glad to say that I found a new server.

    But here is my problem. My account is set up, and all I need is to add my database which I have on my computer.

    But the guy from the server just emailed me to read the tutorial on the cPanel site which is this:
    ___________
    First, create the database.. /path/to/bin/mysqladmin -u $mysqlusername -p$mysqlpassword create $mysqldatabasename Then, add user permission to it... /path/to/bin/mysqladmin -u usernamehere -ppasshere create databasename Finally, add the tables back.... /path/to/bin/mysql -u $mysqlusername -p$mysqlpassword $mysqldatabasename < backup.sql OR: mysql -u user -p -e 'source backup_file' database
    ______________

    Now to me this is chinese, i have no clue what all that means.
    Can someone please help me, how i can add my database to the cPanel? PLEASE!
    With step by step instructions.

    PS: the database name and user name is already added.

    Also my back up file is called qaftalk_qaftalk but my server set up the database name as szilvia_szilvia , will i have to rename the one or the other, or does that matter at all?

    thanks!

  2. #2
    Hello ,,

    In General :

    1/ login to MySQL interface :
    mysql -uroot -p
    then type your MYSQL root password

    as example , My DBname will be Ali_Data
    user name = Ali_Hamad
    My Password = 558822
    Host = Localhost

    2/ to Create a new database :
    create database Ali_Data;

    3/ to creat DataBase user and add user permission to DataBase :
    GRANT ALL PRIVILEGES ON Ali_Data.* TO Ali_Hamad@"localhost" IDENTIFIED BY '558822' WITH GRANT OPTION;

    4/ type " quit " to logout from MySQL interface

    5/ mysqladmin reload

    6/ restore your Database :

    mysql -u $mysqlusername -p$mysqlpassword $mysqldatabasename < backup.sql

    ====
    Also my back up file is called qaftalk_qaftalk but my server set up the database name as szilvia_szilvia , will i have to rename the one or the other, or does that matter at all?
    ====

    doesn't matter at all .

  3. #3
    if you have Cpanel installed , there is no need to use MySQL interface .

    login to your CP : http://YourDomain:2083

    1) To access the MySQL Account Maintenance Menu, click on the Mysql icon above the words MySQL Databases on the main screen of your cPanel interface.
    2) Enter the name of the new database in the blank field next to Db:.
    3) Click on Add Db to create the database

    To create a MySQL user :
    1) Enter the name of the new user in the blank field next to UserName:
    2) Enter the password for the new user in the blank field next to Password:
    3) Click on Add User to create the new user.

    To add user permission to DataBase :
    1) Select the user (the user will apper as mainuser_user) you wish to grant permissions for from the drop box next to User:
    2) Select the database (the database will appear as mainuser_database) you wish to give that user access to from the drop box next to Db:
    3) Select any privileges (abilities to modify the database) you wish the user to have by checking the box next to the privilege's name.
    4) Click on Add User to Db to give the user permission to access the database

    for futher information :
    http://www.cpanel.net/docs/cpanel/

    Best Regards,

  4. #4
    the server set up the user/DB step 3 is done as well however

    I am lost here "TO Ali_Hamad@"localhost" IDENTIFIED BY '558822' WITH GRANT OPTION;"

    do you have to add something to "access host" ? and if yes what exactly (i feel like an idiot)

    then after step four i am lost type in where? are you in the php myadmin? or where are you at that point?

    thanks in advance!

  5. #5
    basically when i go into php myadmin
    it says no tables found on my database since i didn't upload the one backup i have....so how do i do that

    i don't know what this means

    mysql -u $mysqlusername -p$mysqlpassword $mysqldatabasename < backup.sql

  6. #6
    Hello:

    My apologies about my English , but I'm doing my best !!!
    ==
    do you have to add something to "access host" ? and if yes what exactly (i feel like an idiot)
    ==

    depends on where is your MySQl location, it is common to be " localhost or 127.0.0.1" or replace it with your MySQL host IP " as example : in load balance servers "

    To make it clear for you:

    GRANT ALL PRIVILEGES ON DataBaseName.* USER@"YourMysqlHOST" IDENTIFIED BY 'Password' WITH GRANT OPTION;

    ===
    Then after step four i am lost type in where? Are you in the php myadmin? Or where are you at that point?
    ===

    No, I mean type exit or quit to logout from MySQL interface.

    As example:
    mysql> exit
    Bye

    ===
    I don't know what this means

    mysql -u $mysqlusername -p$mysqlpassword $mysqldatabasename < backup.sql
    ====

    to restore your mysql backup , you will use shell command like this :

    mysql -uDatabaseUser -pUserPassword DatabaseName < YourMysqlBackup.sql


    Ali Hamad

  7. #7
    well, i don't understand anything about scripting. I thought i could just upload the backup through cPanel somehow.

  8. #8
    You can load the backup MySQL db in phpMyAdmin easy.

    Just click on the "SQL" tab at the top. Then, on the screen you see "Location of the text file:". Browse for your db file then click go. That's it.

Posting Permissions

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