当前位置: 动力学知识库 > 问答 > 编程问答 >

osx - How do connect to MySQL on Mac OS X El Captain just by typing MySQL?

问题描述:

How do connect to MySQL on Mac OS X El Captain just by typing MySQL? I made a .bash_proile file in my home directory with:

export PATH="/usr/local/mysql/bin:$PATH", but when I type mysql in the terminal when I am in my home directory I get this error - ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Any help would be greatly appreciated!

Also how can I list all the users on the server?

Mahalo,

Johnny

网友答案:

Provide the credentials as command line arguments. From the documentation: http://dev.mysql.com/doc/refman/5.7/en/mysql.html

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: