We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29525
    • 388 Posts
    This is my first attempt at moving a site from local to my server. I have two problem that I suspect are related.

    1. The home page comes up but all the menu links point to my local files not the server. ( I do have rewrite browser paths set to yes)
    2. I’m unable to login to the manager

    I followed the instructions in the tutorial: http://modxcms.com/moving-sites-to-new-servers.html
    I created the DB on the server prior to following these instructions.

    When I try to login to the manager, the error message I receive is
    <br /><b>Warning<b>: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
    <b>/home/terrybar/public_html/manager/includes/settings.inc.php</b>on line<b>10</b></br>
    
    <br /><b>Warning<b>: mysql_fetch_rows(): supplied argument is not a valid MySQL result resource in
    <b>/home/terrybar/public_html/manager/includes/settings.inc.php</b>on line<b>11</b></br>
    
    <br /><b>Warning<b>: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
    <b>/home/terrybar/public_html/manager/processors/login.processor.php</b>on line<b>72</b></br>
    Incorrect username or password entered!


    I found a reference to this that suggested I check for two sets of quotes on the dbase name in the config.inc.php file. I found there were indeed two sets. I corrected this but no effect.

    I have verified the user name and pw in the config.inc.php file matches the DB user name and PW I had previously created.

    I tried changing the user name in the config.inc.php file to my admin user id. This had the effect of no more SQL errors but still Incorrect username or PW when logging into manager and the home page does not come up on the server.

    I’m at a loss as to where to begin short of starting all over again and hoping I don’t just recreate the problem. I do have detailed notes on what I did from the very beginning of this attempt including screen shots.

    Can someone point my in the right direction here?

    Thank you!

    Terry
      www.terrybarthdesign.com
      • 30497
      • 245 Posts
      Hmm, Hi Terry, I too, just moved my first MODx site from local to a web host - literally ten minutes ago, and seem to have come up against the exact same problem, so I thought I’d "join the party".
      I have checked dbase name, password, etc etc. I am using the modx-0961p2.zip release of MODx.

      Unlike Terry, I also get an error when I try to access the homepage (or any page of the site):
      « MODx Parse Error »
      MODx encountered the following error while attempting to parse the requested resource:
      « Failed to select the database ’yoga_yoga’! »

      Parser timing
      MySQL: 0.0000 s (0 Requests)
      PHP: 0.0224 s
      Total: 0.0224 s
      Error while inserting event log into database.
        • 29525
        • 388 Posts
        Hey Tower

        I’m also using 0.9.6.1p2.

        When I changed the username in the config.inc.php file to match my admin ID, my home page did not come up and that is the msg I received.

        Fun party huh?

        Terry
          www.terrybarthdesign.com
          • 30497
          • 245 Posts
          Quote from: Terry at May 03, 2008, 04:35 PM

          Hey Tower

          I’m also using 0.9.6.1p2.

          When I changed the username in the config.inc.php file to match my admin ID, my home page did not come up and that is the msg I received.

          Fun party huh?

          Terry

          the username in my config file does not match my manager log in, but I have triple checked that it matches my database login on the remote server.....

          wanna beer?
            • 30497
            • 245 Posts
            Quote from: ganeshXL at May 04, 2008, 12:48 AM

            Quote from: towerofbabel at May 03, 2008, 04:21 PM

            MODx encountered the following error while attempting to parse the requested resource:
            « Failed to select the database ’yoga_yoga’! »

            Looks like you’re using the DB-name or table-prefix twice. Check and double check the db-settings (e.g. most likely to be found in the control panel of your hosting provider).
            If you don’t use a table prefix on your remote server, change
            $table_prefix = ’modx_’;
            to
            $table_prefix = ’’;
            My web host prefixes all databases in my account with "yoga_" so, I called the new db "yoga" and thus get "yoga_yoga".

            Also, my table prefix as initially set up on my local server is "yoga_". I see this is duplicated when I export the dbase and import back in to "yoga_yoga" on the remote server. Thus, I kept my table prefix as ’yoga_’.

            I’ll try the script you suggest a little later, and report back. thanks.
              • 30497
              • 245 Posts
              Quote from: ganeshXL at May 04, 2008, 01:08 AM

              Here’s a simple script to find out if your db-settings are working or not. Save it as dbtest.php and upload it to your server.


              If you get error messages, your settings are simply not correct. If you see "0 tables found", your connection details are right, but the prefix doesn’t match.

              I get "Couldn’t select database" with this code.
                • 29525
                • 388 Posts
                Well I have determined that I had used the wrong table_prefix.

                I had assumed since the hostmonster added terrybar_ to my DB name that this was also the table prefix. When I looked at the SQL structure, I noticed that every field name active_users, categories, etc. where all shown as terrybarthdesignactive_users, terrybarthdesigncategories. etc.

                $dbase = ’terrybar_terrybarthdesign’;
                $table_prefix = ’terrybarthdesign’;

                Additionally, in my config.inc.php the database_user has terrybar_ in front of the user name, but when I log in to MODx I use only the name without the terrybar_.

                $database_user = ’terrybar_username’;

                Thank you both for your help. It caused my to re-look at all my settings (about a dozen times. . . )
                  www.terrybarthdesign.com
                  • 29525
                  • 388 Posts
                  Now for the 2nd part of my question.

                  All my site pages were pointing back to my local machine. After I was able to login to MODx successfully, I went back to my site front-end and found it was still point to the local machine. sigh. . . .

                  However, once I cleared the cache from MODx Site Tab, problem resolved.

                  I think I’m good to go.

                  Thank you both for your help.

                  Terry
                    www.terrybarthdesign.com
                    • 30497
                    • 245 Posts
                    well done Terry.

                    Unfortunately, I haven’t got a fix..

                    I check and check again but still do not see a problem:
                    $database_type = 'mysql';
                    $database_server = 'localhost';
                    $database_user = 'yoga_yogaweb';
                    $database_password = 'mypasswordhereandconfirmedcorrect';
                    $database_connection_charset = 'utf8';
                    $dbase = '`yoga_yoga`';
                    $table_prefix = 'yoga_';


                    name of database in phpmyadmin: yoga_yoga
                    name of user, created in "MySQL databases": yoga_yogaweb - checked that the user has all database priveledges.
                    checked that the server is localhost.
                    Ran test as described by GaneshXL in previous post. Result: "Couldn’t select database"

                    I am at a loss.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      If you’re using CPanel, are you sure you connected your user "yoga_yogaweb" to the database "yoga_yoga"? I’ve forgotten that step after creating the user a time or two, and even connected a user to the wrong database at least once that I can recall.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org