Transferring a database from server to server

Discussion in 'MySQL' started by jc@ukzone.com, Jun 19, 2008.

  1. #1
    I have transferred a web site and database from a server running Centos 3 to a server running Centos 5.
    I have also transferred the same ip number of the server.

    I have a web site running osCommerce hat works fine on the first server but will not work on the new server. I just get a blank screen.

    When I check the error_log for the site I get:
    PHP Fatal error: Call to undefined function mysql_connect() in /includes/functions/database.php on line 19

    This line seems to call for server, usename and password:
    $$link = mysql_connect($server, $username, $password);

    It seeme to me that I must have forgotten to do something when I transferred the site and database.

    I have tested by reverting to the original site and it works fine.

    Has anybody got any ideas ???

    Thanks
     
    jc@ukzone.com, Jun 19, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    That means that either mysql isn't installed on the new server, or it is not correctly enabled in php.

    Print out a phpinfo() and make sure that --with-mysql.... is in the Configure Command at the top. There should be several mysql related commands in this section. Further down, make sure there is a section with all of the mysql information in it: Active Links, MYSQL_MODULE_TYPE, MYSQL_SOCKET, MYSQL_INCLUDE, etc...
     
    jestep, Jun 19, 2008 IP
  3. jc@ukzone.com

    jc@ukzone.com Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Jestep...
    Many thanks for your reply.
    I have assumed that php and mysql are setup right because there is another web site using php and mysql that is working fine.
    However, I have checked phpinfo() and it says '--without-mysql' . I assume that it should say '--with-mysql'
    When I check the installed packages, I get:
    php-5.1.6-15.el5
    php-ldap-5.1.6-15.el5
    php-pdo-5.1.6-15.el5
    php-mbstring-5.1.6-15.el5
    php-common-5.1.6-15.el5
    php-cli-5.1.6-15.el5
    php-mysql-5.1.6-15.el5

    Is this correct ???

    I cannot see any of the active links that you refer to:
    MYSQL_MODULE_TYPE, MYSQL_SOCKET, MYSQL_INCLUDE, etc...

    Can you suggest where I go from here...

    Thanks
     
    jc@ukzone.com, Jun 19, 2008 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    How did you install php, and what OS is this on?

    The "--without-mysql" removes it from php even if it is installed on the server.
     
    jestep, Jun 19, 2008 IP
  5. jc@ukzone.com

    jc@ukzone.com Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the quick reply jestep...
    The operating system is Centos 5.
    I installed php using rpm's:
    php-common-5.1.6-15.el5.i386.rpm
    php-common-5.1.6-15.SEL5.i386.rpm
    php-common-5.2.6-2.fc9.remi.i386.rpm
    php-mbstring-4.3.9-3.9orc.i386.rpm
    php-mysql-5.1.6-15.el5.i386.rpm
    php-pdo-5.1.6-15.el5.i386.rpm
    php-pdo-5.2.6-2.fc9.remi.i386.rpm
    sqlite2-2.8.17-3.fc9.remi.x86_64.rpm


    Since my last post, I have yummed and installed more php. I now have:
    php-imap-5.1.6-15.el5
    php-xmlrpc-5.1.6-15.el5
    php-odbc-5.1.6-15.el5
    php-5.1.6-15.el5
    php-ldap-5.1.6-15.el5
    php-pdo-5.1.6-15.el5
    php-mbstring-5.1.6-15.el5
    php-xml-5.1.6-15.el5
    php-pear-1.4.9-4
    php-common-5.1.6-15.el5
    php-cli-5.1.6-15.el5
    php-mysql-5.1.6-15.el5
    php-devel-5.1.6-15.el5
    php-gd-5.1.6-15.el5


    My site still doesn't work.

    Thanks for your help...

    John C
     
    jc@ukzone.com, Jun 19, 2008 IP