Announcement

Collapse
No announcement yet.

Problems with moving server....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with moving server....

    I can't run a dump.sql with my SSH connection.

    I have moved server and now try to restore my forums with an sql dump Ive made on my old server.

    I type at the prompt:
    mysql -uUSERNAME -p newdbname < /path/to/dump.sql

    ..then I put in my PW and get this

    Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    Now my provider tells me in his FAQ to type the following right after log into the SSH:

    mysql -h rdbms -u Username -p DBName

    When I do this I get at the start:

    mysql>

    instead of

    www.mydomain.com>

    When I now type whats in the "move server manual" (mysql -uUSERNAME -p newdbname < /path/to/dump.sql) nothing happens.

    Anyone may help me here to import my dump into the DB on the new server? THX!!!
    Last edited by Bonee70; Fri 27 Feb '04, 10:24am.

  • #2
    After typing "mysql -h rdbms -u Username -p DB-Name", Im in a MySQL Monitor.

    Maybe this info clarifies my question a bid.

    Comment


    • #3
      Originally posted by Bonee70
      After typing "mysql -h rdbms -u Username -p DB-Name", Im in a MySQL Monitor.

      Maybe this info clarifies my question a bid.
      Hmmm...this should work:

      mysql -uUsername -ppassword databasename < backup.sql

      Comment


      • #4
        I still get this error message:

        Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

        Im on a SSH connection BTW.

        Comment


        • #5
          When I type in your command here

          mysql> mysql -uUsername -ppassword databasename < backup.sql

          then I get nothing at all just

          ->

          Comment


          • #6
            Originally posted by Bonee70
            When I type in your command here

            mysql> mysql -uUsername -ppassword databasename < backup.sql

            then I get nothing at all just

            ->
            I think it means that mysql has finished what you have asked it to do and you have to exit out of mysql.

            Comment


            • #7
              Its odd somehow.

              Im logged into SSH and typed in my command. Now I get this



              The sql file is about 16MB and I know from my old host that I takes about 1min to import the file. Though I get this message above withn 1 second, and the DB has not imported anything....

              Comment


              • #8
                ..even when I put in a fantasyname as DB-Name I get this message....

                Comment


                • #9
                  Im lost

                  Comment


                  • #10
                    Originally posted by Bonee70
                    Im lost
                    Best bet is to ask one of the staff for advice.

                    Comment


                    • #11
                      Originally posted by Bonee70
                      Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
                      This error means either MySQL crashed, it's not running or it can't find the socket. In your case it may also mean you do not have permission to access that MySQL remotely. You need to contact your host about this. Here is more info on this error:

                      http://www.mysql.com/doc/C/a/Can_not...to_server.html
                      Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                      Change CKEditor Colors to Match Style (for 4.1.4 and above)

                      Steve Machol Photography


                      Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                      Comment


                      • #12
                        Try typing 'status' when you get the 'mysql>' prompt

                        If it says your current database is the one you want to use you can exit your .sql file using 'source /path/to/file'>

                        If it doesnt show your DB as the current you should be able to to type 'use <yourdbnamehere>' and carry on from there.

                        Comment


                        • #13
                          I was contatcing my serverhost today and the prob seems to be in the .sql file.

                          For some reason the "LOCK TABLES" command and the "--" at the beginning of some rows in my .sql dump causes the problem.

                          Code:
                          -- MySQL dump 8.22
                          --
                          -- Host: localhost    Database: forum_cusdb
                          ---------------------------------------------------------
                          -- Server version	3.23.56
                          
                          --
                          -- Table structure for table 'access'
                          --
                          
                          DROP TABLE IF EXISTS access;
                          CREATE TABLE access (
                            userid int(10) unsigned NOT NULL default '0',
                            forumid smallint(5) unsigned NOT NULL default '0',
                            accessmask smallint(5) unsigned NOT NULL default '0',
                            KEY userid (userid,forumid)
                          ) TYPE=MyISAM;
                          
                          /*!40000 ALTER TABLE access DISABLE KEYS */;
                          
                          --
                          -- Dumping data for table 'access'
                          --
                          
                          
                          LOCK TABLES access WRITE;
                          Last edited by Bonee70; Sat 28 Feb '04, 5:36am.

                          Comment


                          • #14
                            OK, it seems like it's definitely the sql dump I get from my old server. I have exported the tables via phpMyAdmin and can put up this .sql file without probs. Odd....

                            Comment


                            • #15
                              This can sometimes be a problem if the MySQL versions (and mysqldump) are different between the old and new hosts.
                              Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                              Change CKEditor Colors to Match Style (for 4.1.4 and above)

                              Steve Machol Photography


                              Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X