0

Until yesterday (when I started playing with the command line), everything was running well and I had a successful connection between mysql and php. At one point I added

sudo cp /private/etc/php.ini.default /private/etc/php.ini

which was not what I wanted (that will teach me to copy and paste!), but I checked and everything was running fine after that.

After restarting my computer the connection to mysql does not seem to be working. So I tried

sudo cp /private/etc/php.ini /private/etc/php.ini.default in the hope that was the culprit but I have had no success.

Ive opened up mysql workbench and can see that all my tables are still there, I have run a simple echo script and php works fine by itself.

How do I relink the php and mysql?

===EDIT===

I have just tried show databases;

| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.01 sec)

This is not what my mysqlworkbench shows, which show 9 different databases. Is it possible I have to mysql running on here and if so how do I get rid of one? (to be more specific the above that is returned in my command line)

tony09uk
  • 2,841
  • 9
  • 45
  • 71
  • before yesterday(when you started playing with the command line) how you were connecting to mysql from php. And now what error you are getting on doing the same? – Nitesh Mishra Dec 18 '13 at 09:53
  • I'm using a php script and the error message is `SQLSTATE[HY000] [2002] No such file or directory` – tony09uk Dec 18 '13 at 09:59
  • This question can help you : [http://stackoverflow.com/questions/2412009/starting-with-zend-tutorial-zend-db-adapter-throws-exception-sqlstatehy000](link) – dardar.moh Dec 18 '13 at 10:32

0 Answers0