0
votes

I configured mysql cluster on my 3 Vm's :

  • ubuntu 12.04 desktop with ndb_mgm node is on 192.168.1.11 and there is no mysql server installed

  • and 2 ubuntu servers 12.04 with sql nodes on 192.168.1.19 and 192.168.1.20
    and now I am trying to run my webpage on ubuntu desktop:

    index.php

    <?php session_start(); include("db-info.php"); $link = mysql_connect ($server1, $user1, $pass1); if (!$link) { $link = mysql_connect ($server2, $user2, $pass2); } if(!mysql_select_db($database)) die(mysql_error()); ?>

    and db-info.php

    <? $server1 = "192.168.1.19"; $user1 = "user1"; $pass1 = "pass1"; $server2 = "192.168.1.20"; $user2 = "user2"; $pass2 = "pass2"; $database = "database"; ?>

    and when i try to run index.php file i give error Call to undefinied mysql_connect() it it necessary to install mysql server on ndb_mgm node?

    after apt-get install php5-mysql error logs

    [Wed May 29 14:25:20 2013] [error] [client 127.0.0.1] PHP Warning: mysql_connect(): Host '192.168.1.11' is not allowed to connect to this MySQL server in /var/www/index.php on line 5

        [Wed May 29 14:25:20 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_connect(): Host '192.168.1.11' is not allowed to connect to this MySQL server in /var/www/index.php on line 7
    
        [Wed May 29 14:25:20 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /var/www/index.php on line 9
    
        [Wed May 29 14:25:20 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_select_db(): A link to the server could not be established in /var/www/index.php on line 9
    
1

1 Answers

0
votes

Install MySQL extension for PHP.

sudo apt-get install php5-mysql