When the phone is connected to the computer via USB, if the "charge only" mode is selected, then the connection can't be made normally. What you need to do is to switch to "MTP mode" or File transfer mode for some models.
For some special phone models like HUAWEI or OPPO, you need to find "Setting",
then find "About phone", next click【Developer options】, then click 【Select USB Configuration】, finally choose【MTP mode】
1. Some mobile phones do not have this option, you can choose "Files Manager" or "View photos".
2. Make sure whether "Charge Only" is selected under the "USB Connection" option. If it is applied, please click "manage files" or "view the photo" to close the mode.