Author Topic: MySQL enter as user problem  (Read 603 times)

0 Members and 1 Guest are viewing this topic.

Offline DreX

  • Serf
  • *
  • Posts: 42
  • Cookies: -5
    • View Profile
MySQL enter as user problem
« on: 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?
« Last Edit: March 22, 2015, 03:47:13 pm by DreX »

Offline Psycho_Coder

  • Knight
  • **
  • Posts: 166
  • Cookies: 84
  • Programmer, Forensic Analyst
    • View Profile
    • Code Hackers Blog
"Don't do anything by half. If you love someone, love them with all your soul. When you hate someone, hate them until it hurts."--- Henry Rollins

Offline DreX

  • Serf
  • *
  • Posts: 42
  • Cookies: -5
    • View Profile
Re: MySQL enter as user problem
« Reply #2 on: March 22, 2015, 06:42:51 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

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.

Offline DreX

  • Serf
  • *
  • Posts: 42
  • Cookies: -5
    • View Profile
Re: MySQL enter as user problem
« Reply #3 on: 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.

Offline srirachasauce

  • /dev/null
  • *
  • Posts: 17
  • Cookies: -2
    • View Profile
Re: MySQL enter as user problem
« Reply #4 on: 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