Mysql Server Connection Error 1045
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 mysql access denied for user 'root'@'localhost' (using password yes) Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Mysql Access Denied For User Using Password Yes
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just error 1045 sqlstate 28000 access denied for user 'root'@'localhost' like you, helping each other. Join them; it only takes a minute: Sign up Enable remote MySQL connection: ERROR 1045 (28000): Access denied for user up vote 101 down vote favorite 52 MySQL 5.1.31 running on Windows XP. 1045 - access denied for user 000webhost From the local MySQL server (192.168.233.142) I can connect as root as follows: >mysql --host=192.168.233.142 --user=root --password=redacted From a remote machine (192.168.233.163), I can see that the mysql port is open: # telnet 192.168.233.142 3306 Trying 192.168.233.142... Connected to 192.168.233.142 (192.168.233.142). But when trying to connect to mysql from the remote machine, I receive: # mysql --host=192.168.233.142 --user=root --password=redacted ERROR 1045 (28000): Access denied for user 'root'@'192.168.233.163' (using password: YES) I have only 2 entries
#1045 - Access Denied For User 000webhost
in mysql.user: Host User Password -------------------------------------- localhost root *blahblahblah % root [same as above] What more do I need to do to enable remote access? EDIT As suggested by Paulo below, I tried replacing the mysql.user entry for % with an IP specific entry, so my user table now looks like this: Host User Password ------------------------------------------ localhost root *blahblahblah 192.168.233.163 root [same as above] I then restarted the machine, but the problem persists. mysql share|improve this question edited Jan 16 at 2:00 asked Dec 5 '11 at 3:50 Mike Chamberlain 8,7031066119 add a comment| 9 Answers 9 active oldest votes up vote 164 down vote You have to put this as root: GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD' with grant option; ; where IP is the IP you want to allow access and USERNAME is the user you use to connect If you want to allow access from any IP just put % instead of your IP and then you only have to put FLUSH PRIVILEGES; Or restart mysql server and that's it. share|improve this answer edited Aug 24 '15 at 12:12 danielad 3,26622248 answered Oct 11 '12 at 17:02 Octavio 1,641263 Worked great for me! –AntonioCS Feb 25 '13 at 22:35 Is there any way to do this without a local mysql client? &ndash
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 #1045 - access denied for user phpmyadmin more about Stack Overflow the company Business Learn more about hiring developers or posting #1045 - access denied for user 000webhost phpmyadmin ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
#1045 Access Denied For User Localhost Using Password Yes
Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) http://stackoverflow.com/questions/8380797/enable-remote-mysql-connection-error-1045-28000-access-denied-for-user up vote 50 down vote favorite 37 I am an electrical engineering who mainly play around with power system instead of programming. Recently, I have been following a manual to install a software suite on Ubuntu. I have no knowledge on mySQL at all, actually. I have done the following installations on my Ubuntu. sudo apt-get update sudo apt-get install mysql-server-5.5 sudo apt-get install mysql-client-5.5 sudo apt-get install http://stackoverflow.com/questions/21944936/error-1045-28000-access-denied-for-user-rootlocalhost-using-password-y mysql-common sudo apt-get install glade sudo apt-get install ntp Then I do me@ubuntu:~/Desktop/iPDC-v1.3.1/DBServer-1.1$ mysql -uroot -proot <"Db.sql" I ended up with the following error message. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) How may I fix it and continue? mysql linux ubuntu share|improve this question asked Feb 21 '14 at 20:52 Sibbs Gambling 3,2621042104 1 This does not seem to be strictly programming-related to me. I flagged it for migration to SuperUser –Uli Köhler Feb 21 '14 at 20:55 add a comment| 12 Answers 12 active oldest votes up vote 54 down vote accepted The default root password is blank (i.e. empty string) not root. So you can just login as: mysql -u root You should obviously change your root password after installation mysqladmin -u root password [newpassword] In most cases you should also set up individual user accounts before working extensively with the DB as well. Update: For MySQL 5.7+ please see answer from @Anshu to this question. That contains more current information. share|improve this answer edited Aug 29 at 13:40 answered Feb 21 '14 at 20:54 Mike Brant 51.7k54670 Thanks for the quick answer. Could you please explain what the -proot <"Db.sql part does?
phpMyAdmin, you could possibly encounter the error: #1045 Access Denied for user 'root'@'localhost' (using password: YES).If root@localhost wasn't granted the necessary rights to access the database or you provided https://www.ostraining.com/blog/coding/error-1045-phpmyadmin/ the wrong password, you will then encounter this error.Following this tutorial will help guide you on bypassing this error, for any local host server using phpMyAdmin.If you get an Error #1045 in http://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost phpMyAdmin it will look like the image below:Step 1: Open your MySQL console. Using WAMP, left click your WAMP icon located at the bottom right of your desktop and click on MySQL Console. access denied Guide to accessing MySQL using XAMPP Guide to accessing MySQL using MAMP. Step 2: Enter the Provided Command LinesIf you have a password, you can ignore this part. Type in: use mysql; Press Enter. Set your MySQL Password: UPDATE mysql.user SET Password=PASSWORD("EnterYourPasswordHere") WHERE User="root"; Replace "EnterYourPasswordHere" with your new chosen password. Press Enter. Flush the privileges: FLUSH PRIVILEGES; Exit by typing: Exit Press Enter. Step access denied for 3: Open and edit your config.inc.php file located in your local server files Using a text editor, such as Notepad++, open your config.inc.php file. Go to My Computer > C Drive > (Your Local Server Folder, WAMP/MAMP/XAMPP) > APPS > PHPMYADMIN > config.inc.php Find this line of code: $cfg['Servers'][$i]['password'] = ''; // MySQL password Change 'password' to the new chosen password you created from Step 2. Click Save. Step 4: Access phpMyAdmin You can access phpMyAdmin by going to http://localhost/phpMyAdmin/. Congratulations! You are now able to access your databases. View the discussion thread. blog comments powered by DISQUS back to top Blog Categories WordPress TutorialsDrupal TutorialsJoomla TutorialsCoding TutorialsOSTraining NewsWeb Design TutorialsBlog LicenseAll our blog posts are published under the Creative CommonsAttribution-NonCommercial license: You can re-use these tutorials. You can modify these tutorials. You must link back to our original tutorial. You can't use these tutorials commercially. Full license details.Our Training Video Training Books On-Site Training Our Books MySQL Explained Drupal 7 Explained Joomla 3 Explained Joomla Explained About OSTraining About Us Our Team Our Blog Partner With Us Become an Affiliate Become a Video Trainer Become a Tutorial Writer Advertise with Us support@ostraining.co
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 more about hiring developers or posting ads with us Super User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power users. 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 how to fix Access denied for user 'root'@'localhost' up vote 52 down vote favorite 31 Before I screw up something, when login using $ mysql -u root -p, and show databases: +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | game_data | | test | +--------------------+ Then I try to create a new user and notice something is wrong with the PRIVILEGES. So I deleted the new users, and I guess I removed the 'root' and 'Admin' accidentally. Then I try to create 'root' again, but get Access denied error when doing grant all privileges. mysql> CREATE USER 'root'@'localhost' IDENTIFIED BY 'password'; mysql> grant all privileges on *.* to 'root'@'localhost' identified by 'password' with grant option; ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) If I login mysql again using $ mysql -u root -p, and show databases, +--------------------+ | Database | +--------------------+ | information_schema | +--------------------+ All the other databases are gone. How do I fix mysql now? I cannot cannot find the database 'mysql', cannot create database, create user, anything I try to do will get an error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES). Should I reinstall mysql using macports? If reinstall, I will lost the database 'game_data', right? mysql user-accounts login privileges share|improve this question edited Dec 31 '15 at 11:36 Eric Leschinski 2,73742642 asked Jun 3 '13 at 7:32 Vogelsire 363146 migrated from stackoverflow.com Jun 3 '13 at 8:32 This question came from our site for professional and enthusiast programmers. Try accesing the server with 'root'@'127.0.0.1' which is diferent from 'root'@