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.

MySQL Errors

Discussion in 'General Discussion' started by Arhineus, Mar 13, 2008.

  1. Arhineus

    Arhineus Well-Known Member

    Joined:
    Nov 1, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    I just setup a new server, and am starting to move sites over to it.

    On one of our sites, I'm getting the following error, which I have never seen below.

    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/username/public_html/libs/dbinfo.php on line 371

    Everything was working for this site on the old machine, so I'm a bit curious as to what might be the problem.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    If I were curious I'd want to know if the database and user for it, were actually there and do the details match whatever this config file is looking for.

    Lots of results for this error on Google though.
     
  3. Arhineus

    Arhineus Well-Known Member

    Joined:
    Nov 1, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    The database, user, password, and everything was transferred correctly. I checked the config file, and it wasn't corrupted at all. I moved everything via SSH (/scripts/pkgacct & /scripts/restorepkg) so everything should be AOK.

    I'm still looking at this though, as I haven't come across any answers yet.
     
  4. daniel.groza

    daniel.groza Registered

    Joined:
    Nov 13, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    It seems like /scripts/pkgacct is messing up the databases:
    try this:
    1. pick a database from one account and generate a mysqldump file => clean file
    2. generate a full backup of the same account using /scripts/pkgacct, unzip the file and check the *.sql file(of the same database) inside the mysql dir. you'll find a lot of comments right in the middle of the queries => messed up file
    As an example:
    Code:
     UNIQUE KEY `SiteURL` (`SiteURL`),
      KEY `Cat[B][COLOR="Red"]-- Sending SELECT query...
    -- Retrieving rows...[/COLOR][/B]
    egory` (`Category`)
    
    http://bugzilla.cpanel.net/show_bug.cgi?id=6412
     
    #4 daniel.groza, Mar 14, 2008
    Last edited: Mar 14, 2008
  5. daniel.groza

    daniel.groza Registered

    Joined:
    Nov 13, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    quick fix:

    edit /scripts/pkgacct and remove the '-v' option:

    before:
    Code:
     mysqldumpdb( { 'options' => [ @downgrade_options, '-c', '-Q', '-q', '-v' ], 'db' => $db, 'file' =>
    after:
    Code:
     mysqldumpdb( { 'options' => [ @downgrade_options, '-c', '-Q', '-q' ], 'db' => $db, 'file' =>
    /scripts/pkgacct is generating clean dumps now
    ;)
     
Loading...

Share This Page