Find the answer to your Linux question:
Results 1 to 6 of 6
Hi I installed apache2, php, phpMyAdmin -2.5.6, mysql and all dependant packages ; could successfully start these services in a SUSE m/c. But i couldnot connect to the database from ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    2

    MySQL with phpMyAdmin


    Hi

    I installed apache2, php, phpMyAdmin -2.5.6, mysql and all dependant packages ; could successfully start these services in a SUSE m/c.

    But i couldnot connect to the database from phpMyAdmin though I could connect the database server from a mysql client with a root user(password ***).

    The error says "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)"

    -Hari

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    did you look throught he phpmyadmin/config.inc.php file for all the config variables?
    There's 4 u need to look at:

    $cfg['PmaAbsoluteUri']

    NEEDS to be set to the FULL path to phpmyadmin and IS case sensitive eg:

    $cfg['PmaAbsoluteUri'] = 'http://www.foo.com/phpMyAdmin';

    Then the only other one i worry about is:

    $cfg['Servers'][$i]['auth_type']

    which i st to http as:

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

    This will cause the browser to prompt for a username and password every time you try to access the phpMyAdmin, MUCH more secure than the default config value since that allows anyone access that the configured user(they recommend root) has (EVERYTHING), so just set that to http and u should b ok.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Just Joined!
    Join Date
    Jan 2006
    Posts
    2

    ~Happy New Year 2006

    Thanks Sdousley,

    The error shown on the phpMyAdmin webpage is "phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection.You should check the host , username and password in config.inc.php and make sure that they correcpond to the information given by the administrator of the MySQL server"

    Using the "config" auth type with both username(root) & password(***) entries. I can connect to the server with these credentials from a mysql cli but goes faulty with phpMyadmin ???(i dont understand)
    I pointed "localhost" as a host in config.inc.php and the webpage comes up with http://localhost/phpMyAdmin/.

    As u said I changed to "http" in config file and tried, I was asked for username and password, still i was denied the access with the error "wrong username/password".

    Tell me what can be done to fix this??

    thanks in advance
    Hari

  4. #4
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    you could try this

    Go to /etc/my.cnf and change/add the lines:

    [mysqld]
    datadir=/var/lib/mysql
    socket=/tmp/mysql.sock
    [client]
    socket=/tmp/mysql.sock

    This way the client and server use the same socket and it's in a public directory

    you could also try this
    http://forums.devarticles.com/mysql-...ough-4635.html

    and when all else fails
    (lots of stuff here)
    http://www.google.com/search?hs=InK&...ck&btnG=Search

  5. #5
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by harikanths
    The error shown on the phpMyAdmin webpage is "phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection.You should check the host , username and password in config.inc.php and make sure that they correcpond to the information given by the administrator of the MySQL server"
    Was php definitely compiled in with MySQL support? That's the only other thing i can think of.... try making a new page with this code in it:

    Code:
    <?phpinfo();?>
    and look for mysql in there...
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  6. #6
    Just Joined!
    Join Date
    Jun 2010
    Posts
    1

    Thank you

    Quote Originally Posted by sdousley View Post
    did you look throught he phpmyadmin/config.inc.php file for all the config variables?
    There's 4 u need to look at:


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

    This will cause the browser to prompt for a username and password every time you try to access the phpMyAdmin, MUCH more secure than the default config value since that allows anyone access that the configured user(they recommend root) has (EVERYTHING), so just set that to http and u should b ok.
    This was the spot on fix for my issue, and thank you kindly for the direction!

Posting Permissions

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