The php program in the virtual space cannot access mysql. how can this problem be solved?

Source: Internet
Author: User
The php program in the virtual space cannot access mysql and runs normally locally. if it is thrown into the space, it cannot be accessed (the database address is changed, and the database table is also created, statement can also be accurately executed ). I tried several methods, but none of them worked. Do you have any experience in this field, and do you have to set something to waste space? & Nbsp; it is best to give a simple link case and find out the data. thank you very much. The php program I used to query the virtual space on the Internet cannot access mysql.
The local operation is normal and cannot be accessed when it is thrown into the space (the database address is changed, the database table is also created, and the statement can be accurately executed ).
I tried several methods, but none of them worked.
Do you have any experience in this field, and do you have to set something to waste space?
It is best to give a simple link case and find out the data. thank you very much.
I have searched the Internet for several link methods, but they are useless.



------ Solution --------------------
Debug based on the error message.
------ Solution --------------------
What does your "inaccessible" mean? You should provide more information.
------ Solution --------------------
Use database tools to access databases
The local build runs normally.
500 error

Based on your information and code snippets, you can only say that your server does not support mysqli extension.
Try to use mysql extension
------ Solution --------------------
The information you sent is too limited. you can send the relevant code block to see which line of error is supported.

I suspect that the path of the file referenced by include () is incorrect.
------ Solution --------------------
Use the header to specify the character set.
------ Solution --------------------
Add the following line of code at the beginning of php to try to see if other errors will be output:
PHP code
Error_reporting (E_ALL );
------ Solution --------------------
A user name or password error causes a series of subsequent errors. Solve the character set first. The output is garbled.
------ Solution --------------------
Access denied for user 'zuohou66xy1 '@ '483ef4cdf4b24bb'
Access is denied. is the database on a remote machine? Database User and permission configuration issues.
------ Solution --------------------
Indeed, access is denied.

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.