简体   繁体   中英

Installed MySQL Server on Mac OSX 10.7.5, receiving a 1045 (28000) error when trying to access MySQL

Relatively new to SQL, I am reaching out for any advice on how to access MySQL via the Terminal shell on a MAC OSX 10.7.5 system. I have gotten this far detailed in the script below, and followed all installation guides on the web, as well as doing a fair amount of troubleshooting to try and move past the "ACCESS DENIED to "KV88@localhost, PASWORD: NO".

Can anyone provide insight on to why I can't input regular MySQL syntax and access the server, I believe I am still stuck in the BASH script environment.

SCRIPT:

ClickAways-MacBook:~ KV88$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

Starting MySQL database server

ClickAways-MacBook:~ KV88$ /usr/local/mysql/bin/mysql

ERROR 1045 (28000): Access denied for user 'KV88'@'localhost' (using password: NO)

ClickAways-MacBook:~ KV88$

Thanks in advance

During the installation you had to be asked about root password. So, you can access the server like this:

mysql -u root -p

and input your password. Then give access to your user:

GRANT ALL PRIVLIEGES ON *.* TO 'KV88'@'%' IDENTIFIED BY "<password>";

if you want for a user to be able to do (almost) everything, or create a database under root and give access to this database:

CREATE DATABASE mydb;
GRANT ALL PRIVLIEGES ON mydb.* TO 'KV88'@'%' IDENTIFIED BY '<password>';

Then exit mysql and enter as a user:

mysql -u KV88 -p

or

mysql -u KV88 -p mydb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM