The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What is Putty asking for here?

Discussion in 'Data Protection' started by greenchicken, Apr 27, 2006.

  1. greenchicken

    greenchicken Member

    Joined:
    Apr 26, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    does not look like its asking anything looks s like you just opened a SSH session or am I missing somthing here?
     
  3. greenchicken

    greenchicken Member

    Joined:
    Apr 26, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I am a newbie i need a tutorial on how to do commands in SSH, you don't know of any do you?

    what I am basically trying to do is learn how to import mysql databases thru SSH
     
  4. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    get yourself a linux book :D

    wget the file from another server or use scp or upload from you home computrer

    then
    resotore databse

    mysql -u username -pPassword database_name < path/db.sql


    see your pm i sent just a few SSH commands
     
  5. greenchicken

    greenchicken Member

    Joined:
    Apr 26, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Thank you very much for your help, I am currently trying to use navicat to restore database and it looks very promising, I am getting this error

    [Err] 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1' at line 6
    [Msg] Finished - Unsuccessfully

    have you ever seen this or know what it means or how to fix it?
     
  6. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    I would guess your trying to import a mysql 4.0 sql file into a mysql 4.1

    make the 2 mysql versions the same or use the mysql command line it will usally import via the command line
     
  7. greenchicken

    greenchicken Member

    Joined:
    Apr 26, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Man you are a lot of help, if I get this baby figured out I am buying you either a 6 pack of beer or Coke depending on your age :D

    I used the command line in ssh and it gave me the same error as it did in the navicat now I am off to google how to make a 4.0 database compatible with a 4.1
     
  8. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    In your mysql database file just get rid of that default charset line and it will probably import. :) You can use a text editor to edit that database file.
     
  9. InforHosting

    InforHosting Member

    Joined:
    Apr 27, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cd
    Use this command to change your current directory. The root of the hard disk is "/". The current directory "./". The parent directory of the current one is "../", and it's parent is "../../", etc. Most commands will assume the current folder if you try manipulating a file with establishing a path. /usr/local is where you will find most software, including Apache and most control panels, such as cPanel.
    d/dir
    This command lists the contents of a directory. You can add a path to the end of this command to list all the contents of that folder, or you can just leave it without a parameter to list all the contents off the current folder.
    cp
    This command copies files. The syntax is to first write the current path of the file(s), and then the destination. In order to copy full folders, and add a /* to the end of the path of your folder. You don't need to modify the destination at all. If you want to copy without questioning any overwrites, use cp -f (f = force).
    vi
    This is Linux's sort of "notepad." See here for more info: http://www.comptechdoc.org/os/linux/...inux_ugvi.html.
    chmod
    You can modify permissions on files using this command. The syntax is to first write the permissions you want (eg. 444, 644, 777), and then give the path to the file you want to modfiy.
    tail
    This will give you the end contents of a file you specify. Handy for viewing small files or log files without going into a text editor.
    locate
    Will find any files in your system under the name you specify.
    rm
    Will remove a file. Use rm -f /path/* to removed all files from folder "path."
    rmdir
    Will remove a directory. However, it must be empty.
    mkdir
    Make a new directory.
    tar
    Untar or untar-gzip a file. Use tar -xzf for untar-gzipping.
    top
    Will give you some system details, kind of like Task Manager.
    du
    Will check your disk usage.
    httpd
    On most systems, this refers to Apache's httpd daemon. Typing it in with any parameters should "start" httpd. If this is not the case, it is probably calling apachectl. This httpd will be located in /path/to/apache/bin/httpd.
    apachectl
    This is a kind-of Apache monitor. It allows you to start, stop, restart, etc. Apache.
    apxs
    This is used for installing modules into Apache. See here: http://httpd.apache.org/docs/1.3/programs/apxs.html.
    lynx
    This is Linux's built in text browser. In order to scroll links, use the up and down keys.
    man - It provides greater information about a asked for mandate

    ps - List the processes that are executed at the moment

    find - Used to locate a file/folder

    more - Used to unfold the text of a file by screens
    Ej.: more /home/lpt/file1.txt

    cat - Used to visualize the contents of a file
    Ej.: cat /home/lpt/file1.txt

    FROM WEBHOSTINGTALK.COM ;) http://webhostingtalk.com/showthread.php?t=490289
     
  10. greenchicken

    greenchicken Member

    Joined:
    Apr 26, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    but what if that database file is 300+ mb uncompressed, what can I use as an editor then?

    also thank you InforHosting
     
  11. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    Beer please
     
  12. greenchicken

    greenchicken Member

    Joined:
    Apr 26, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1

    Ok this is the deal let me get a bit specific

    I run a pretty large vbulleitn site like this forum

    my site grew so big that shared hosts kicked me off

    now I have a virtual dedicated server


    ok the way the mysql is set up now, the vbulletin installs perfectly, i can download the database created, I can then import that database.

    Here is the problem and you hit the nail on the head.

    phpmyadmin reports that mysql is MySQL - 4.0.25-standard

    I am assuming the database(s) I am trying to import are different versions and conflicting , I tried removing that charset latin line and it gives another error and so on and so on is there a way to convert a database over to MySQL - 4.0.25-standard or am I basically screwed, or do I have to upgrade my mysql? and of course, I have no idea how to do that either :rolleyes:
     
  13. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    If you're lucky, the version of MySQL from which the backup queries were generated may be present in comments at the start of each .sql file. Take a look.

    If it is the case that your backup is for 4.1 and you're running 4.0, you should simply be able to upgrade from 4.0 to 4.1 in WHM and then give it a shot again.

    The errors you encountered regarding character sets give the impression that your backups are from a 4.1 database. If so, you'll definitely have no luck squeezing a 4.1 backup into a 4.0 database.
     
  14. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    just look at the dump file from the old it should say the mysql ver set your vps to match
     
  15. InforHosting

    InforHosting Member

    Joined:
    Apr 27, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thank you.
     
  16. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Well then you let your box help you out. :) replace is another great command line tool to learn about - do man replace to read the manual...

    Code:
     replace "DEFAULT CHARSET=latin1" "" -- /your_database_file_path.sql
    
    Let us know if the upgrade suggested helps, it should. You might be having TYPE problems, meaning the databases from the different versions might be different types (MYISAM, INNODB, etc). If that's the case you could also eliminate "TYPE=" statements from your dump files as well to get them to import properly.

    Best way, though is to get both places running latest stable and eliminating the need for all that. :)
     

Share This Page