Mysql error


#1

I have a script running, but on that page it says:

Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /home/.grumpcat/mana1023/fan.mysticalmagick.com/aflower/config.php on line 43
Cannot connect to the database. Try again.

I filled out a customer service form, but its almost a day and I’d like to get it resolved. Does anyone know what could be the problem?


#2

Did it used to work?

Check your config for the proper username, password, database name, and database server. The server should not be ‘localhost.’ It should be the servername you created in the control panel for Manage MySQL.

To test, you can log into your database with your browser by going to DBSERVER.yourdomain.com (change DBSERVER to what you set up) and log in with your DBUser and DBPassword.

-Scott


#3

I’m new to dreamhost and transfering everything over from my old host, so I haven’t tried it before. I’ve checked everything for the proper names and put mysql.mysticalmagick.com instead of localhost, but still it doesn’t work. I tested and it works.


#4

You’re saying that you tested the web interface to the database? If that worked, then that’s the info you need for your config file: mysql.mysticalmagick.com, the username, the password, and the database name (which is shown on the left when you first connect to mysql.mysticalmagick.com). But you’re saying you checked the proper names.

Weird. If all that works from your web browser, it should work from your PHP scripts. I tried fan.mysticalmagick.com, and its complaining about something in /enth/show_collective_stats.php. Is this part of the same setup that was in /aflower?

-Scott


#5

Yes, its all a part of the same setup/script. For some reason it can’t connect to the database. Could it have something to do with the database being at mysticalmagick.com and the script within the subdomain fan.mysticalmagick.com?


#6

After two days of agony I just figured out what was wrong and got it to work. I was importing the mysql file from my old site after creating the database and unknown to me the old mysql file still had the old config info. Thanks for your help though! :slight_smile: