简体   繁体   English

连接时拒绝MySQL服务器访问

[英]MySQL server access denied while connecting

I have installed Mysql on Mac os 10.7 using dmg installer, it got installed at location /usr/local/mysql I also installed MySQL.prefpane, where I can start and stop the server using services. 我已经使用dmg installer在Mac OS 10.7上安装了Mysql,它安装在/usr/local/mysql我还安装了MySQL.prefpane,可以在其中使用服务启动和停止服务器。 i am facing below problems. 我面临以下问题。

mysql> create database test    ;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'ets'

same happens when I am trying to invoke mysql by using below command 当我尝试使用以下命令调用mysql时也会发生同样的情况

./mysql -u root root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Even when I created a connection using Eclipse to mysql db then also I got similar kind of exception. 即使当我使用Eclipse创建与mysql db的连接时,我也遇到了类似的异常。

Just want to know after installation do I need to make any further configuration related to user management and access privileges? 只想知道安装后是否需要进行与用户管理和访问权限有关的任何进一步配置?

Try this, 尝试这个,

./mysql -uroot -pPassword ./mysql -uroot -p密码

To give the user all priviliges, execute this command: 要赋予用户所有特权,请执行以下命令:

GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY PASSWORD 'yourpassword' WITH GRANT OPTION

Also try 也试试

CREATE SCHEMA test;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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