Error Message Access Denied For User Using Password Yes
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn error 1045 28000 access denied for user using password yes more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Mysql Error 1045 Access Denied For User Using Password Yes
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you,
Error No 1045 Access Denied For User Using Password Yes
helping each other. Join them; it only takes a minute: Sign up “Connect failed: Access denied for user 'root'@'localhost' (using password: YES)” from php function up vote 33 down vote favorite 13 I wrote some function used by
Could Not Connect Access Denied For User Using Password Yes
a php webpage, in order to interact with a mysql database. When I test them on my server I get this error: "Connect failed: Access denied for user 'root'@'localhost' (using password: YES)" I am able to use them on my pc (using XAMPP) and I can navigate through the tables of the database using the command line in the server. Instead, the webpage fails to connect. I've checked the password but with no results, it's correct mysql access denied for user 'root'@'localhost' (using password yes) (otherwise I could not log in to mysql from the command line). The call of the function is the following: $conn = new mysqli("localhost", "root", "password", "shop"); Have I to set something in my server? Thanks Edit: PHP version 5.3.3-7+squeeze1 mysql version: 5.1.49-3 both on debian php mysql access-denied share|improve this question edited Jun 22 '11 at 23:21 asked Jun 22 '11 at 18:49 fbrundu 1,97194476 migrated from superuser.com Jun 22 '11 at 20:11 This question came from our site for computer enthusiasts and power users. 1 What version of PHP are you running? What version of MySQL? It sounds similar to bitshop.com/Blogs/tabid/95/EntryId/67/… –Jack Murdoch Jun 22 '11 at 20:16 add a comment| 8 Answers 8 active oldest votes up vote 48 down vote accepted I solved in this way: I logged in with root username mysql -u root -p -h localhost I created a new user with CREATE USER 'francesco'@'localhost' IDENTIFIED BY 'some_pass'; then I created the database CREATE DATABASE shop; I granted privileges for new user for this database GRANT ALL PRIVILEGES ON shop.* TO 'francesco'@'localhost'; Then I logged out root and logged in new user quit; mysql -u francesco -p -h localhost I rebuilt my database using a script source shop.sql; And that's it.. Now from php works without problems with the call $conn = new mysqli("localhost", "francesco", "some_pass", "shop"); Thanks
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site mysql access denied for user using password yes About Us Learn more about Stack Overflow the company Business Learn more about mysql access denied for user using password no hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join access denied for user 'root'@'localhost' (using password yes) when trying to connect the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Access denied for user http://stackoverflow.com/questions/6445917/connect-failed-access-denied-for-user-rootlocalhost-using-password-yes 'test'@'ip'(using password: YES) up vote 1 down vote favorite I have found many posts for this error, tried everything but still getting same error.I am trying to connect to mysql on ubuntu server from my remote app and mysql client. Let me post whatever steps I have taken already : Stop the firewall on ubuntu server : iptables -F. Also tried with sudo service ufw http://stackoverflow.com/questions/34845130/access-denied-for-user-testipusing-password-yes stop. Commented "bind-address" in /etc/mysql/my.cnf and restarted mysql. Added user in mysql : CREATE USER 'test'@'%' IDENTIFIED BY 'testpwd'; GRANT ALL PRIVILEGES ON . TO 'test'@'%' IDENTIFIED BY 'testpwd' WITH GRANT OPTION; FLUSH PRIVILEGES; I can see the entry of new user by "Select host, user from mysql.user"; restarted mysql again. Still the same error! Now I thought maybe there is some problem still with firewall, so added :iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT Problem still persist. Help will be really appreciated otherwise I will be in serious trouble. mysql share|improve this question edited Jan 17 at 23:41 Marcin Orlowski 41.8k65187 asked Jan 17 at 23:36 Ashutosh Khard 345 can you connect locally? –Dagon Jan 17 at 23:39 try to connect on mysql on the server in the command line (mysql -u root -p yourdatabase). If it doesn't work, you can try 'sudo service mysql stop', then 'sudo service mysql start'. If the stop doesn't work, pkill mysql several times and retstart 'sudo service mysql start'. Got that problem on ubuntu. –Pierre Emmanuel Lallemant Jan 17 at 23:40 That error will only
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might http://dba.stackexchange.com/questions/10852/mysql-error-access-denied-for-user-alocalhost-using-password-yes have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to access denied improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top MySQL error: Access denied for user 'a'@'localhost' (using password: YES) up vote 19 access denied for down vote favorite 8 I use the root account created the account 'a'@'%'. But I can't use the account to connect to MySQL server when I specify the host parameter. I can successfully connect without the -h parameter. Please see the transcript below. I hope someone can help me to explain it. Thanks. mysql> grant all on *.* to 'a'@'%' identified by a; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a' at line 1 mysql> grant all on *.* to 'a'@'%' identified by 'a'; Query OK, 0 rows affected (0.00 sec) mysql> show grants for 'a'@'%'; +-----------------------------------------------------------------------------------------------------------+ | Grants for a@% | +-----------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'a'@'%' IDENTIFIED BY PASSWORD '*667F407DE7C6AD07358FA38DAED7828A72014B4E' | +-----------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> exit Bye [root@localhost ~]# mysql -h localhost -u a -p Enter password: ERROR 1045 (28000): Access denied for user 'a'@'localhost' (usin