Help Needed: MySql Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Keev
    Confirmed User
    • May 2001
    • 5335

    #1

    Help Needed: MySql Question

    Here is the situation....

    I am getting ready to revamp dnclassifieds.com completely and I need to extract the mysql database and its info so i can get some info out of it and have it configured to work with the new system that is being built....


    How would i extract it and be able to get info out of it?


    This is on a NT Box and its running in coldfusion..


    Keev
    104463163
    ReliableServers.com - NO REF LINK!
  • Ace-Ace
    Confirmed User
    • May 2002
    • 1863

    #2
    NT Box, hmmm...I know for unix (redhat actually), this'll do it:

    mysql -p(passwordhere no space after the -p) (database name to extract to) < /absolute/path/to/*.sql

    Obviously, don't use the parenthesis.
    JamPlay.com - Online, video-based guitar lessons

    Comment

    • Tipsy
      Confirmed User
      • Jul 2001
      • 6989

      #3
      Installing phpmyadmin on the new (or both) machines can make life a LOT easier if you're not too hot on MySQL and need to move stuff.
      Ignorance is never bliss.

      Comment

      • Tipsy
        Confirmed User
        • Jul 2001
        • 6989

        #4
        Oops - that'll teach me. Totally missed the NT box thing. Still, it may have an NT version.
        Ignorance is never bliss.

        Comment

        • SetTheWorldonFire
          Confirmed User
          • Feb 2002
          • 7444

          #5
          http://www.mysqlstudio.com/
          www.STWOFDesign.com
          hit me up on icq 154206276 or Skype: JaimeGizzle

          Comment

          • Big E
            Registered User
            • Mar 2002
            • 935

            #6
            mysqldump [db_name] > some_file

            move 'some_file' to new server

            myqladmin create [db_name]
            mysql [db_name] < some_file

            pretty simple..

            Comment

            • foe
              Confirmed User
              • May 2002
              • 5246

              #7
              just use mysqldump it comes with windows install and is located under the bin directory in your mysql instillation

              Comment

              • wsjb78
                Confirmed User
                • Jun 2002
                • 594

                #8
                if you can run PHP and I'm pretty sure you can install phpMyAdmin.... once setup, just select the database you want, select all tables in the database and select table structure and data and you can download it to your comp as a .sql file.

                that's the easiest way....


                Backing up mySQL from the command line:

                Log into telnet. Then move to the directory where you want the backup to be. then type:

                mysqldump -u mysqlusername -p mysqldatabase > dumpfile.sql;

                (Note: the ";" at the end is important to have it recognised as a mysql command)

                Then you'll be asked for your mysql password. Just enter it without any ";" at the end.

                Then ftp in and go to the dir. Download the .sql file and there you go.

                Restoring the data to the database (same or different) is easy. Just log in into telnet again, change to the appropriate directory where you have your .sql stored and enter following:

                mysqldump -u mysqlusername -p mysqldatabase < dumpfile.sql;

                Then you'll be asked again for your password.


                I don't really know if this works on your box....

                Contact me if you have problems!

                Comment

                • mike503
                  Confirmed User
                  • May 2002
                  • 2243

                  #9
                  you don't run mysqldump the second time to import it, you run mysqlimport or you can simply do

                  mysql -uUSER -pPASS -A < file.sql

                  assuming the file.sql has the create database foo; use foo; lines.
                  php/mysql guru. hosting, coding, all that jazz.

                  Comment

                  Working...