EvilZone

Programming and Scripting => Web Oriented Coding => : DreX March 22, 2015, 03:46:57 PM

: MySQL enter as user problem
: DreX March 22, 2015, 03:46:57 PM
First of all, I'm completely new to MySQL.

I had installed ZendServer before (following my pdf guide) but have then uninstalled it and installed wampserver 2.5.
In my guide I created a new user:
GRANT ALL ON publications.* TO 'jim'@'localhost' IDENTIFIED BY 'password';

Then I quitted and tried to see if it worked with:
D:\wamp\bin\mysql\mysql5.6.17 -u jim -p;
But i get ERROR 1064...

What must I enter to get this right?
: Re: MySQL enter as user problem
: Psycho_Coder March 22, 2015, 05:51:23 PM
See if these help

http://www.inmotionhosting.com/support/website/database-troubleshooting/error-1064

http://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064
: Re: MySQL enter as user problem
: DreX March 22, 2015, 06:42:51 PM
See if these help

http://www.inmotionhosting.com/support/website/database-troubleshooting/error-1064 (http://www.inmotionhosting.com/support/website/database-troubleshooting/error-1064)

http://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064 (http://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064)

Nope, I don't see the solution here.

My problem is that I don't know the command line for logging in as a user.
here is a pic.
: Re: MySQL enter as user problem
: DreX March 22, 2015, 09:53:21 PM
Solved it with friends help.
I was issuing the command:
-u jim -p
from the mysql.exe directly and not from cmd (which when opened immediately loged me in as root).

So i had to navigate with cmd to my mysql.exe first. Once there I put in:
mysql -u jim -p
and then password

And now it works.
: Re: MySQL enter as user problem
: srirachasauce March 27, 2015, 03:51:24 AM
Another thing that you can do if you did not want to type the passphrase each login is use the ~/.my.cnf file to store it locally. One thing to note is that storing a password in clear text on the system is typically bad practice. So avoid adding root / super user credentials there. Just like you wouldn't use the root user to login to mysql every time from your application. I see that you're on windows...I haven't done much windows MySQL stuff. But here's some additional reading on implementing these files if you were interested, it does make some things easier and faster:

http://dev.mysql.com/doc/refman/5.1/en/option-files.html