Authentication to host '***‘' for user 'root' using method 'mysql_native_password' failed with message: Reading from the stream has failed.

  The following scenario:

  A page requires the user to fill in text information and upload a picture. To upload a picture, the upload file interface is called separately. When the user uploads the picture and clicks save immediately, an error will be reported.

  Authentication to host '***‘' for user 'root' using method 'mysql_native_password' failed with message: Reading from the stream has failed.

The real reason is that the picture has not been uploaded completely, and at the same time, click Save, and the dependency relationship is not followed (the picture must be uploaded before clicking Save to submit the data).

Solution:

1. After filling in the information, pause for a while.

2. Add mandatory dependencies on the front end, that is, users are not allowed to click save before the image is uploaded, and a progress bar and other similar methods can be used.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324535472&siteId=291194637