multi-db error, no websites

Warning: mysql_get_server_info(): supplied argument is not a valid MySQL-Link resource in /home/leonaaz/public_html/wp-content/db.php on line 669

Warning: Cannot modify header information - headers already sent by (output started at /home/leonaaz/public_html/wp-content/db.php:669) in /home/leonaaz/public_html/wp-includes/functions.php on line 3191
Error establishing a database connection

What is the cause for this error. When trying to get to the websites this error appears. When I remove db.php, the error goes away?

The databases all appear in myPHP and all the 20 sites continue to work if dp.php is removed.

  • Larry_D
    • Site Builder, Child of Zeus

    This is the error that appeared above, not below the multiple database conversion window when I ran the script to move-blogs.php

    [21-Apr-2011 12:48:21] PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/leonaaz/public_html/wp-content/scripts/move-blogs.php on line 140
    [21-Apr-2011 12:48:21] PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/leonaaz/public_html/wp-content/scripts/move-blogs.php on line 141

    The error was duplicated several time.

  • Barry
    • DEV MAN’s Mascot

    Warning: mysql_get_server_info(): supplied argument is not a valid MySQL-Link resource in /home/leonaaz/public_html/wp-content/db.php on line 669

    The above suggests that the script can't access the database - it could be because of the address or name, but is more likely a user / permissions issue. Can you check the database permissions for the user you are using?

  • becky
    • The Incredible Code Injector

    I just saw Barry replied to your one of your post to remove Line 25.

    @Barry, I had Line 25 global db table for both versions 3.0.5 and 3.0.6, and my sites work ok. There were some warnings after the move blog steps but the tables seem to have created properly and moved properly. Been using my sites for over a mth with multi-db installed this way. Seem to be working ok. This is included in Step 3 db-config.php point no.3 in the installation instruction (please see screenshot)

    Not sure if there would be any side-effects but fingers crossed, everything seem to work fine so far.

  • Barry
    • DEV MAN’s Mascot

    @Barry, I had Line 25 global db table for both versions 3.0.5 and 3.0.6, and my sites work ok. There were some warnings after the move blog steps but the tables seem to have created properly and moved properly.

    It's usually the move blogs script that blows up with that line in there because it can't find the table to move.

  • Barry
    • DEV MAN’s Mascot

    Can you switch your wp-config.php database settings over to point at the global database and let me know what happens? It may display an error, the type of which will tell us what the problem could be.

    If you get Error Couldn't find database - it's the db location / IP address or user account.

  • Larry_D
    • Site Builder, Child of Zeus

    Barry not sure what to do, this is my current wp-config.php.

    * @package WordPress
    */

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'leonaaz_mouse');

    /** MySQL database username */
    define('DB_USER', 'leonaaz_user');

    /** MySQL database password */
    define('DB_PASSWORD', 'word');

    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');

    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');

    /**#@+
    * Authentication Unique Keys and Salts.
    *
    * Change these to different unique phrases!
    * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
    * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
    *
    * @since 2.6.0
    */
    define('AUTH_KEY', 'put your unique phrase here');
    define('SECURE_AUTH_KEY', 'put your unique phrase here');
    define('LOGGED_IN_KEY', 'put your unique phrase here');
    define('NONCE_KEY', 'put your unique phrase here');
    define('AUTH_SALT', 'put your unique phrase here');
    define('SECURE_AUTH_SALT', 'put your unique phrase here');
    define('LOGGED_IN_SALT', 'put your unique phrase here');
    define('NONCE_SALT', 'put your unique phrase here');

    /**#@-*/

    /**
    * WordPress Database Table prefix.
    *
    * You can have multiple installations in one database if you give each a unique
    * prefix. Only numbers, letters, and underscores please!
    */
    $table_prefix = 'wp_';

    /**
    * WordPress Localized Language, defaults to English.
    *
    * Change this to localize WordPress. A corresponding MO file for the chosen
    * language must be installed to wp-content/languages. For example, install
    * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
    * language support.
    */
    define('WPLANG', '');

    /**
    * For developers: WordPress debugging mode.
    *
    * Change this to true to enable the display of notices during development.
    * It is strongly recommended that plugin and theme developers use WP_DEBUG
    * in their development environments.
    */
    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'leonaaz.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    /* That's all, stop editing! Happy blogging. */

  • Barry
    • DEV MAN’s Mascot

    Change this:
    define('DB_NAME', 'leonaaz_mouse');

    to this:
    define('DB_NAME', 'leonaaz_global');

    Assuming the username and password you have in wp-config.php are the same in db-config.php, otherwise change those to be the same as db-config.php as well.

  • Larry_D
    • Site Builder, Child of Zeus

    Changed to: define('DB_NAME', 'leonaaz_global');

    No luck...

    Warning: mysql_get_server_info(): supplied argument is not a valid MySQL-Link resource in /home/leonaaz/public_html/wp-content/db.php on line 669

    Warning: Cannot modify header information - headers already sent by (output started at /home/leonaaz/public_html/wp-content/db.php:669) in /home/leonaaz/public_html/wp-includes/functions.php on line 3191
    Error establishing a database connection

  • Barry
    • DEV MAN’s Mascot

    When you remove the file dp.php in either websites all the sub-domains sites appear to work. ????

    That's because it goes back to using the original database with the correct permissions. Unless you still have it pointing at global?

  • Philip John
    • DEV MAN’s Apprentice

    Hiya,

    Just checking if it was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, could you let us know by re-opening this topic, and we'll get onto it and helping you out asap!

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Cheers,
    Phil

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.