Home > Database > Mysql Tutorial > 在Ubuntu下MySQL不能链接的问题

在Ubuntu下MySQL不能链接的问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:00:20
Original
959 people have browsed it

在Ubuntu下面安装mysql 用户名密码都正确,但是在myeclipse下面连接数据库的时候确报错了!具体错误代码:Access denied for use

在Ubuntu下面安装mysql 用户名密码都正确,但是在myeclipse下面连接数据库的时候确报错了!具体错误代码:Access denied for user 'root'@'localhost' (using password: YES)!再往上搜了一会,发现是权限问题,导致不能登录!前提是我的数据库设有密码,并且从命令行里登录的时候是正常的!

解决方案如下:grant all on *.* to root@"%" identified by "密码";这样分配了权限问题就解决了!


--------------------------------分割线--------------------------------

输入mysql命令:myql -u root -p ***之后出现:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)。这个问题很是让我纠结,因为自己刚刚搬家到linux,,一点都不懂!!于是乎,mysql卸了重新安装。无数次,之后终于在今天我发现了一点,就是当我关闭了mysql进程以后,再执行命令:myql -u root -p ***就会报错。上网搜的时候多数人回答是权限问题,有的人建议重新安装。但是会不会有的人和我一样,关闭了本地的mysql服务,然后客户端登录,出现了这样错误!!这也确实是一个权限问题,因为服务没开,谁给你权限呢!注意了!

linux

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template