Author Topic: [SOLVED] Failed to connect to database with data you provided:  (Read 7595 times)

sciamanozx

  • Newbie
  • *
  • Posts: 4
    • View Profile
i have this error:
Failed to connect to database with data you provided: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock (2)

hosting linux aruba.it
myslq: MyISAM -> innodb is disable on server
host: localhost
url: http://www.zipmail.it/o/
database is ok
can you help me? Please ;)
« Last Edit: June 22, 2010, 06:03:48 pm by sciamanozx »

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Have you checked your DB username and password

sciamanozx

  • Newbie
  • *
  • Posts: 4
    • View Profile

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
On a separate script try:

Code: [Select]
if(!$link = mysql_connect(#HOSTNAME#, #USERNAME#, #PASSWORD#)) die('Invalid login data');

if(!mysql_select_db(#DB_NAME#, $link)) die('Database does not exist');

print 'All OK';

Replace all #xxx# with your mysql server info

sciamanozx

  • Newbie
  • *
  • Posts: 4
    • View Profile
where i copy the script?

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Create a new PHP file with this content and access it through browser

Code: [Select]
<?php
if(!$link mysql_connect(#HOSTNAME#, #USERNAME#, #PASSWORD#)) die('Invalid login data');

if(!mysql_select_db(#DB_NAME#, $link)) die('Database does not exist');

print 'All OK';
?>


sciamanozx

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: [SOLVED] Failed to connect to database with data you provided:
« Reply #6 on: June 22, 2010, 06:04:39 pm »
Thank you. work.  ;D

twainb03

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: [SOLVED] Failed to connect to database with data you provided:
« Reply #7 on: July 26, 2010, 04:01:50 pm »
Where exactly would you put this script? I'm having very similar problems and I tried this before but didn't work. So I'm not sure where to put it.

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: [SOLVED] Failed to connect to database with data you provided:
« Reply #8 on: July 26, 2010, 05:42:05 pm »
Anywhere. It's just to test that the params you are using are OK.

twainb03

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: [SOLVED] Failed to connect to database with data you provided:
« Reply #9 on: July 26, 2010, 06:08:16 pm »
Ok I did and it said ok connected but then when I try the install it still doesn't work. it still gets stuck on step 3.

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: [SOLVED] Failed to connect to database with data you provided:
« Reply #10 on: July 26, 2010, 06:40:06 pm »
We need more information on the error you are getting.

twainb03

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: [SOLVED] Failed to connect to database with data you provided:
« Reply #11 on: July 26, 2010, 07:14:34 pm »
I'm getting the same error as the guy who started the topic. I have my database setup. I've followed the steps and the installation doesn't get past step 3.

I get this error:

Failed to connect to database with data you provided: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock (2)

After creating new ones, etc. I get it no matter what.

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: [SOLVED] Failed to connect to database with data you provided:
« Reply #12 on: July 28, 2010, 10:02:23 am »
This error means that your connection information is invalid. Are you definitely sure you are not writing users or passwords incorrectly (i.e. a trailing space after a password due to copy-paste) ?

Any server or network configuration that might prevent the connection from being established?