we are making an collage project that is about to store website name , category , and details so we are done with website and now we want to make app that will communicate w
I have encountered similiar issues in the past. You should try changing localhost to 127.0.0.1, assuming your MySQL server is running on the same box.
My belief is that the issue that you are encountering is that "localhost" uses a UNIX socket and can not find the database in the standard directory. However "127.0.0.1" uses TCP , which essentially means it runs through the "local internet" on the machine, being much more reliable than a UNIX socket.