Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialYuichi Narisawa
19,548 PointsI cannot connect to the server. Please help!
I've just followed the tutorial and installed the MySQL and workbench. However, I've got "Failed to Connect to MySQL at localhost: 3306 with user root Access denied for user 'root'@'localhost'(using password:YES)" How can I run this server?
1 Answer
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsWhich OS do you have ?
The problem is when you install MySQL server temporary password is generated for root user
I advice you install 5.7 version, because upon installation it prints root password
http://dev.mysql.com/doc/refman/5.7/en/osx-installation-pkg.html
If you have installed 5.6 password, and don't know how to reset. Try my guide here
It may help, may not, but you can take a look how to reset root password.
The same thing on Windows
http://dev.mysql.com/doc/refman/5.7/en/mysql-installer-gui.html
So I strongly recommend to remove old version , if it was < 5.6 and install new 5.7
Yuichi Narisawa
19,548 PointsYuichi Narisawa
19,548 PointsHi Alex! Thank you for the info! I didn't pay attention for the password during the installation. I use Mac OSX, and I re-installed it as your suggestion. This time, I took a picture of the password, and carefully typed in... I'm not sure the process I did was right, but somehow I could connect to the server! Thank you so much!
Oh, BTW, Is there any place to store the password which is generated by the program?
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsAlexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsWhat do you mean where to store it ?
Write it down somewhere safe. There is a way to change it to the one you can remember but it is much harder.
Since you are using your database for non-commercial purposes, you can write it down in some file on computer, not that is so dangerous for someone to see this password.
And it also should give you an option to remember password ...
I use Linux, so I cannot play around and say more unfortunately ...
Yuichi Narisawa
19,548 PointsYuichi Narisawa
19,548 PointsI mean, if the installer generated some log file of the password in a system, I could find it without re-install. Never mind, I understand the concept and it works!
Again, Thank you so much!
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsAlexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsNow I see what you mean.
You are right upon installation, there should be so-called
mysqld.log
file, in which this temporary password should be printedThe pathway depends on your OS
According to this post:
http://stackoverflow.com/questions/33326065/unable-to-access-mysql-after-it-automatically-generated-a-temporary-password
It should be in
/var/log/mysqld.log
But that probably for Linux.
For Mac such file should be somewhere in
/usr/local/mysql/data/mysqld.log
According to post here
http://serverfault.com/questions/42531/where-is-my-mysql-log-on-os-x
Like I said, I don't have Mac around, so I can't say more, but if you want to dig into it, you can try from those locations
Yuichi Narisawa
19,548 PointsYuichi Narisawa
19,548 PointsThank you for the detailed info! I've never dealt with this kind of stuff, so almost everything is new to me. Sometimes they're really intimidating and overwhelming, but I can keep going because of you guys give me a great advice whenever I stack. I really appreciate it!