I got an error.

Error Code:

Warning: Invalid argument supplied for foreach() in /home/touchcpa/public_html/wp-content/db.php on line 164
Fatal error: Call to undefined method m_wpdb::handle_error_connecting() in /home/touchcpa/public_html/wp-content/db.php on line 223

Here's my setting...

db-config.php:

define ('DB_SCALING', '16');
add_dc_ip('127.0.0.1', 'dc1');
add_global_table('andytsai_nrg_global');

add_db_server('global', 'dc1', 1, 1,'','127.0.0.1', 'andytsai_nrg_global', 'user', 'pass');
add_db_server('0', 'dc1', 1, 1,'','127.0.0.1', 'andytsai_nrg_0', 'user', 'pass');
add_db_server('1', 'dc1', 1, 1,'','127.0.0.1', 'andytsai_nrg_1', 'user', 'pass');

move-blogs.php:

$dbname = "andytsai_nrg_";
$blog_table_prefix = 'wpmu_';
$newdb_prefix = 'andytsai_nrg_';

$dbhost = 'localhost';
$dbuname = 'user';
$dbpass = 'pass';

$db_scaling = '16';

I don't understand where's wrong.
Could anyone help me to solve this problem?
Or you have the same problem.
Thanks a lot.

  • Mason
    • DEV MAN’s Sidekick

    Hiya!

    When are you getting this error? During move-blogs.php?

    Just to make sure, you do have all 16 new databases in your db-config file right? Not just the 2 lines you show above (plus the global db).

    I'll ask the dev team to stop by as well and see if anyone else has an idea for ya.

    Thanks!

  • JimKernan
    • Flash Drive

    I am getting the same errors when I try to access might site's homepage. I went through the installation process and everything seemed to work fine. However, I cannot access my site unless I remove the multi-db files. Any suggestions?

  • turkon
    • Flash Drive

    I have solved the problem. I was living the problem because of localhost.Firstly I have put an ip there. Use like below. The errors will go. And everything seems working right now.

    add_db_server('global', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_global', 'username', 'password');
    add_db_server('0', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_0', 'username', 'password');
    add_db_server('1', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_1', 'username', 'password');
    add_db_server('2', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_2', 'username', 'password');
    add_db_server('3', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_3', 'username', 'password');
    add_db_server('4', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_4', 'username', 'password');
    add_db_server('5', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_5', 'username', 'password');
    add_db_server('6', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_6', 'username', 'password');
    add_db_server('7', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_7', 'username', 'password');
    add_db_server('8', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_8', 'username', 'password');
    add_db_server('9', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_9', 'username', 'password');
    add_db_server('a', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_a', 'username', 'password');
    add_db_server('b', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_b', 'username', 'password');
    add_db_server('c', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_c', 'username', 'password');
    add_db_server('d', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_d', 'username', 'password');
    add_db_server('e', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_e', 'username', 'password');
    add_db_server('f', 'dc1', 1, 1,'174.123.140.120','localhost', 'ra6org1_f', 'username', 'password');

    But I have some questions,how will I be sure about the server's database if it is using the old one or new ones?

    Regards,
    Mustafa

  • turkon
    • Flash Drive

    James, I have disabled the users for my old database. And I am getting the error. So I think I was using the old database. What is the reason for this? What must I do?
    Regards,
    Mustafa

    Error establishing a database connection

  • turkon
    • Flash Drive

    I think I have solved the problem by changing wp-config to my new global database and password.

    But I have seen that I didnt add
    add_global_table('ra6org1_global'); to the first line of db-config before.

    I have now changed it like below. So will it make a problem changing it later?

    add_global_table('ra6org1_global');
    add_global_table('autoblog');
    add_global_table('blogs');
    add_global_table('blog_versions');
    add_global_table('commentmeta');
    add_global_table('comments');
    add_global_table('forums');
    add_global_table('forums_posts');
    add_global_table('forums_topics');
    add_global_table('links');
    add_global_table('options');
    add_global_table('postmeta');
    add_global_table('posts');
    add_global_table('registration_log');
    add_global_table('scaptcha');
    add_global_table('scaptcha_logs');
    add_global_table('signups');
    add_global_table('signup_language');
    add_global_table('site');
    add_global_table('sitemeta');
    add_global_table('site_posts');
    add_global_table('support_faq');
    add_global_table('support_faq_cats');
    add_global_table('support_tickets');
    add_global_table('support_tickets_cats');
    add_global_table('support_tickets_messages');
    add_global_table('terms');
    add_global_table('term_counts');
    add_global_table('term_relationships');
    add_global_table('term_taxonomy');
    add_global_table('usermeta');
    add_global_table('users');
    add_global_table('ust');

  • turkon
    • Flash Drive

    Sorry correcting my last post.

    Everything seems working correct now. But drmike has told me above to remove some things from db-config like add_global_table('users'); So which ones above must stay? And which ones I must remove?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.