Professional Web Applications Themes

Cannot connect to mysql database on another server with phpmyadmin. - MySQL

At my company we want a new configuration for our webservers. Two loadbalanced webservers (linux and apache) and one database and (nfs) fileserver. MySQL is only installed on db server. Apache is only installed on webservers. (Even the websites (files) are on the dbnfs server, mounted with an nfs mount to the webservers). When I want to use phpmyadmin to connect to the database I get #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) I already made changes to php.ini and config.inc.php (phpmyadmin) but keep getting same error message. There is ...

  1. #1

    Default Cannot connect to mysql database on another server with phpmyadmin.

    At my company we want a new configuration for our webservers. Two
    loadbalanced webservers (linux and apache) and one database and (nfs)
    fileserver. MySQL is only installed on db server. Apache is only
    installed on webservers. (Even the websites (files) are on the dbnfs
    server, mounted with an nfs mount to the webservers).
    When I want to use phpmyadmin to connect to the database I get
    #2002 - The server is not responding (or the local MySQL server's
    socket is not correctly configured)

    I already made changes to php.ini and config.inc.php (phpmyadmin) but
    keep getting same error message. There is no local socket. MySQL is
    not installed on the webserver. I did install apache with mysql
    support.

    I have no problem making a connection with a php-script
    (mysql_connect('192.168.6.3', 'username', 'password')), selecting
    database and executing a query. So I guess the settings in the php.ini
    are correct.

    Info from phpinfo();
    mysql
    MySQL Support enabled
    Active Persistent Links 0
    Active Links 0
    Client API version 4.1.20
    MYSQL_MODULE_TYPE external
    MYSQL_SOCKET /var/lib/mysql/mysql.sock
    MYSQL_INCLUDE -I/usr/include/mysql
    MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient

    Directive Local Value Master Value
    mysql.allow_persistent On On
    mysql.connect_timeout 60 60
    mysql.default_host 192.168.6.3 192.168.6.3
    mysql.default_password no value no value
    mysql.default_port 3306 3306
    mysql.default_socket 192.168.6.3:/var/lib/mysql/mysql.sock
    192.168.6.3:/var/lib/mysql/mysql.sock
    mysql.default_user no value no value
    mysql.max_links Unlimited Unlimited
    mysql.max_persistent Unlimited Unlimited
    mysql.trace_mode Off Off

    conf.inc.php (phpmyadmin)
    $i++;

    /* Authentication type */

    $cfg['Servers'][$i]['auth_type'] = 'cookie';

    /* Server parameters */

    $cfg['Servers'][$i]['host'] = '192.168.6.3:3306';

    $cfg['Servers'][$i]['connect_type'] = 'tcp';

    $cfg['Servers'][$i]['compress'] = false;

    /* Select mysqli if your server has it */

    $cfg['Servers'][$i]['extension'] = 'mysql';

    php.ini
    [MySQL]
    ; Allow or prevent persistent links.
    mysql.allow_persistent = On

    ; Maximum number of persistent links. -1 means no limit.
    mysql.max_persistent = -1

    ; Maximum number of links (persistent + non-persistent). -1 means no
    limit.
    mysql.max_links = -1

    ; Default port number for mysql_connect(). If unset, mysql_connect()
    will use
    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order). Win32 will
    only look
    ; at MYSQL_PORT.
    mysql.default_port = 3306

    ; Default socket name for local MySQL connects. If empty, uses the
    built-in
    ; MySQL defaults.
    mysql.default_socket = /var/lib/mysql/mysql.sock

    ; Default host for mysql_connect() (doesn't apply in safe mode).
    mysql.default_host = 192.168.6.3

    ; Default user for mysql_connect() (doesn't apply in safe mode).
    mysql.default_user =

    ; Default password for mysql_connect() (doesn't apply in safe mode).
    ; Note that this is generally a *bad* idea to store passwords in this
    file.
    ; *Any* user with PHP access can run 'echo
    get_cfg_var("mysql.default_password")
    ; and reveal this password! And of course, any users with read access
    to this
    ; file will be able to reveal the password as well.
    mysql.default_password =

    ; Maximum time (in seconds) for connect timeout. -1 means no limit
    mysql.connect_timeout = 60

    ; Trace mode. When trace_mode is active (=On), warnings for table/
    index scans and
    ; SQL-Errors will be displayed.
    mysql.trace_mode = Off

    Pugi! Guest

  2. #2

    Default Re: Cannot connect to mysql database on another server with phpmyadmin.

    Maybe I should emphasize that there is no local mysql on the webserver
    with phpMyAdmin. I just want to connect to remote databases. From
    webservers with a local mysql it is possible to connect to the remote
    mysql-server with phpmyadmin.

    Pugi!

    On 10 apr, 11:32, "Pugi!" <com> wrote: 


    Pugi! Guest

  3. #3

    Default Re: Cannot connect to mysql database on another server with phpmyadmin.

    On 10 Apr, 13:11, "Pugi!" <com> wrote: 























    >
    > - Show quoted text -[/ref]

    Please DO NOT multi-post!!!!

    Cross post if you must but do not multi-post, it just wastes people's
    time.

    Captain Guest

  4. #4

    Default Re: Cannot connect to mysql database on another server with phpmyadmin.

    >Maybe I should emphasize that there is no local mysql on the webserver 

    If there is no local mysql server (there must be at least a MySQL client)
    on the webserver, then there is no local socket. Use TCP/IP.
     [/ref]

    So the above is wrong. Set it to reflect NO socket. You can't specify
    a host on a local socket.
     [/ref]

    If you've got safe mode on, it looks like you'll have to explicitly
    specify this in mysql_connect calls, which you said work.
    Gordon Guest

Similar Threads

  1. Replies: 0
    Last Post: January 29th, 02:03 PM
  2. Replies: 7
    Last Post: June 12th, 07:43 AM
  3. mysql database connect
    By mukraker in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 11th, 03:32 PM
  4. Replies: 1
    Last Post: January 27th, 02:49 AM
  5. Replies: 0
    Last Post: January 24th, 10:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139