[英]Using MySQL Workbench on Linux Mint 18
I've never had a MySQL install go smoothly. 我从来没有顺利进行过MySQL安装。 Not Mac.
不是Mac。 Not Windows.
不是Windows。 And now Linux joins the mess.
现在,Linux陷入了混乱。
I installed mysql-server via Software Manager after a failed attempt with linuxbrew. linuxbrew尝试失败后,我通过软件管理器安装了mysql-server。 I can actually run it in terminal, but I have to use
sudo
which seems odd. 我实际上可以在终端中运行它,但是我必须使用
sudo
,这似乎很奇怪。 I don't see any examples where the user has to use sudo
. 我看不到用户必须使用
sudo
任何示例。
On top of that, when I run MySQL Workbench I can't connect. 最重要的是,当我运行MySQL Workbench时,我无法连接。 I get the error,
Access denied for user 'root'@'localhost'
我收到错误消息,
Access denied for user 'root'@'localhost'
Any suggestions? 有什么建议么?
Did you install mysql from apt-get install mysql-server ? 您是否从apt-get install mysql-server安装了mysql? it probably asked you for a default root password (Ubuntu like systems usually do).
它可能会要求您提供默认的root密码(Ubuntu像系统通常一样)。 If you have forgotten it, have no fear, the password can be reset
如果您忘记了密码,别担心,可以重置密码
http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html#resetting-permissions-unix http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html#resetting-permissions-unix
Try doing this as linux root (sudo -i), if that doesn't work try 尝试以linux根目录(sudo -i)进行操作,如果这样做不起作用,请尝试
sudo -i
sudo mysql
and give it a shot. 试一试。
Alternatively, sudo, connect to mysql and create another user account with full privileges something like 或者,sudo,连接到mysql并创建具有完全特权的另一个用户帐户,例如
GRANT ALL ON *.* to someother user identified by ...
You cannot connect remotely with root database user since the default user created doesn't have access on '%' (remote access). 您无法与根数据库用户远程连接,因为创建的默认用户无权访问'%'(远程访问)。
Create another user with limited rights (secure) and use it for workbench. 创建另一个具有有限权限(安全)的用户,并将其用于工作台。
creating user on mysql: 在mysql上创建用户:
create user test@'%' identified by 'test_user_password';
grant all on *.* to test; -- you can specify specific permissions/databases
flush privileges;
Try these credentials with workbench. 在工作台上尝试使用这些凭据。
As far as the linux command line is concerned 就Linux命令行而言
mysql -uroot -p
-- hit enter, no password and see if you can get connected
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.