PHP connection MySQL Error troubleshooting one example

Source: Internet
Author: User

PHP background is not connected to the MySQL database, view phpinfo,mysql driver normal.

View Logs

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/9D/70/wKioL1mALB-ykR1IAAAipn-2nrs045.png-wh_500x0-wm_ 3-wmp_4-s_2710672881.png "title=" Qq20170801152132.png "alt=" Wkiol1malb-ykr1iaaaipn-2nrs045.png-wh_50 "/>

The problem that the configuration is correct, the connection is rejected, and the suspect may be a user right

Accessing the database to view users and permissions

[Email protected] wezchina]# mysql-h 192.168.2.100-p 3306-usbsbl6tnulzki21-penter password:error 1045 (28000): Acces s denied for user ' user ' @ ' mycloudserver ' (using password:yes) [[email protected] wezchina]# mysql-u root-p found IP address resolved to host name and Be refused
mysql> select user,host from mysql.user;+-----------------+---------------+| user             | host           |+-----------------+---------------+| sbsbl6tnulzki21 | %              | |  root            | 127.0.0.1      | |  sbsbl6tnulzki21 | 192.168.2.*   | |  root            | ::1            | |                  |  localhost     | |  sbsbl6tnulzki21 | localhost     | |  root            | localhost      | |                  |  mycloudserver | |  sbsbl6tnulzki21 | mycloudserver | |  root            | mycloudserver |+ -----------------+---------------+10 rows in set  (0.00 sec) to view the user host and find that the hostname is lowercase in/etc/ The Hosts file adds the following parsing 192.168.2.100 mycloudserver mycloudserver login   Normal


This article is from the "10850395" blog, please be sure to keep this source http://10860395.blog.51cto.com/10850395/1952668

PHP connection MySQL Error troubleshooting one example

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.