What should I do to resolve "access denied for user 'root'@'localhost' (using password: NO)" error message while connecting to the database from a PHP application I wrote?
-
This is my first PHP application at http://www.cmdanigeria.org but the database connection has been giving me huge challenges. please help me to solve this problem. I have already uploaded all my php files through filezilla in the www folder of the cpanel. I have successfully exported and imported the database from my WAMP-phpmyadmin to the phpmyadmin on the cpanel(remote server). Please tell me what to do in order to make my site visible and connected to the database.
-
Answer:
This problem can be resolve by this: query " show grants for root@localhost;" you will found that this user is no privileges , and what you need is just add privileges to root@localhost;
Dehua Yang at Quora Visit the source
Other answers
The root user probably has a password assigned to it and you'll need to reset that password if you do not know what it is. Instructions on how to do this can be found here http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
David Condrey
Right now you are using root user which is working on your local machine. But on production server, you have to create your a new MySQL user to use in your application. Follow this (http://www.siteground.com/tutorials/php-mysql/mysql_database_user.htm) to create a MySQL user in CPanel. And use newly created username and password in your application connection file/configuration. You also need to give permissions to user cmdanige_doc to access to your database. Ref to section "Adding a user to a MySQL Database Detailed Tutorial" in the above mentioned link. Here is official CPanel documentation http://docs.cpanel.net/twiki/bin/view/11_30/CpanelDocs/MySQLDatabases
Muhammad Wasif
Related Q & A:
- Are SQL Injection vulnerabilities in a PHP application acceptable if mod_security is enabled?Best solution by Programmers
- Why do I get the error "A network error occured while connecting to the server?Best solution by Yahoo! Answers
- I encountered a error message.Best solution by Yahoo! Answers
- What can I do if my email got hacked and the changed the password?Best solution by ChaCha
- What do I do when I forget my user password?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.