Re: Syntax Errors: Unable to logon with DB Admin account created MySQL Installer
Posted by: Ian Coates
Date: April 07, 2016 09:32PM

To update, I found several references via:
http://stackoverflow.com/questions/11266957/how-to-switch-to-new-user-from-mysql-console

to the following Windows - Command Prompt (syntax):

mysql --user=user_name --password=your_password db_name

(later found in MySQL 5.7 Manual - 4.5 MySQL Client Programs)
http://dev.mysql.com/doc/refman/5.7/en/programs-client.html

This gave me first access to my user: adminian using the Windows - Command Prompt
(not MySQL 5.7 Command Line Client):

Navigated via cd to:
C:\MySQL\MySQL Server 5.7\bin> (NB. to point to the mysql.exe on this installation)

then substituting above for my own situation entered

mysql --user=adminian --password=user_password aus_states (Enter)

This gave a security warning error but at least allowed me to: use aus_states (my database as this user)

another option suggested accessing the

MySQL 5.7 Command Line Client (shortcut Properties)
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MySQL\MySQL Server 5.7

"C:\MySQL\MySQL Server 5.7\bin\mysql.exe" "--defaults-file=C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" "-uroot" "-p"

substituting

"C:\MySQL\MySQL Server 5.7\bin\mysql.exe" "--defaults-file=C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" "-uadminian" "-p"


This also worked!

Another stackoverflow.com posted method which works OK.
Go to: Control Panel - System - Environment Variables (button) Added PATH: C:\MySQL\MySQL Server 5.7\bin
Then in Windows cmd cd.. to C:\> cd mysql to C:\mysql> prompt then enter e.g. -u adminian -p (Enter)
this prompts for Password ****** enter and login All OK.

So, I now have 2 methods for user access via the Windows Command Prompt & MySQL 5.7 Command Line Client


NB.There are no doubt better / more secure options still to be found using the default .ini or .cfg files supplied with MySQL it's understanding how these work together.

Check the forums for Peter Brawley - his website / ebook looks helpful too!

Any feedback appreciated.

Ian

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Syntax Errors: Unable to logon with DB Admin account created MySQL Installer
871
April 07, 2016 09:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.