Install problem: Can't connect to local MySQL server through

Discuss installing Symfony 2 here

Moderators: dcobalt, tiagojsag

Install problem: Can't connect to local MySQL server through

Postby Marinica » Tue Jan 31, 2012 3:39 pm

Hello all,

I have a problem with symfony setup. The database setup work normally on local environment (Mac, Snow Leopard), but when I tried to move it to remote server (in dev mode) I always receive this error:

Warning: mysql_real_escape_string() [<a href='http://ch2.php.net/manual/en/function.mysql-real-escape-string.php'>function.mysql-real-escape-string.php</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in some_path/UserController.php line 51

I check phpinfo() and this path /tmp/mysql.sock is correct. Database connection parameters are ok, I tested it with mysql_connect and mysql_select_db.
I read about deleting cache and I did it manually in app/cache folder and it didn't help.
What I'm doing wrong?
Marinica
Junior Member
 
Posts: 1
Joined: Tue Jan 31, 2012 3:30 pm

Re: Install problem: Can't connect to local MySQL server thr

Postby althaus » Wed Feb 01, 2012 8:17 pm

Have you tried (with a simple PHP script for example) that the MySQL thing is working on your server at all?
althaus
Faithful Member
 
Posts: 605
Joined: Tue Oct 18, 2011 2:20 pm
Location: Germany

Re: Install problem: Can't connect to local MySQL server thr

Postby dreipunktnull » Wed Feb 01, 2012 9:21 pm

If it's working on your mac using 'localhost' as the mysql hostname, try switching it to '127.0.0.1' on the other machine. It's working for me at least when I move stuff from my mac to my linux machine at the office.
User avatar
dreipunktnull
Faithful Member
 
Posts: 1244
Joined: Fri Jun 17, 2011 10:03 am
Location: Germany


Return to Installation and setup

Who is online

Users browsing this forum: No registered users and 1 guest