Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我运行它sudo service mysql时,它工作得很好,但是当我运行它时mysql -u root,我收到一条错误消息:
sudo service mysql
mysql -u root
拒绝用户访问:'root'@'@localhost'
我该如何解决?我需要检查 /etc/mysql/my.cnf 中的内容吗?
尝试执行 -p - 这应该会提示您输入密码。