CLOUD9: Troubleshoot thinkphp "No such file or directory" error when connecting to database at run time on C9

Source: Internet
Author: User

Yesterday tried to deploy a thinkphp for development on C9, but there was a problem when trying to connect to the database. After finding the data found this problem is caused by not finding Mysql.sock This file (this thing is estimated to be the connection thread of MySQL). Then, the bitter force, and change php.ini but a little effect has not, finally found a soft connection method, but the tutorial gave the address does not apply to C9. At last it was unbearable to knock a bit of MySQL, suddenly jumped out of a line "ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/run/mysqld/mysqld . Sock ' (2) ". The moment is bright, this is not exactly the address you are looking for (>_<).

Don't say much nonsense. I say how to solve this problem, open a terminal, and then enter

sudo Ln -S  /home/ubuntu/lib/mysql/socket/mysql.sock/var/run/mysqld/mysqld.sock

Enter, if you do not have any hints to succeed, try again.

CLOUD9: Troubleshoot thinkphp "No such file or directory" error when connecting to database at run time on C9

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.