版权所有,未经博主允许不得转载。

今天发现服务器mysql连接不上,报

can't connect to mysql server on 'root'@'ip' (61)

照例ssh到服务器,发现mysql也进入不了,报错Access denied for user 'root'@'localhost' (using password:YES), 以前都是可以的(好几次出现这种情况)。今天整理下--系统linux. mysql 5.5

谷歌了下,发现解决方法:

1、首先查看mysql 3306端口是否打开。。命令

netstat -an | grep 3306

这个时候发现3306监听的确没有开启。so这个时候停掉mysql服务。命令

/etc/init.d/mysql stop

查看mysql是否停掉,命令

ps -ax |grep mysql

若停掉,则不会看到mysql进程

若未停掉,多试几次

2、then启动mysql,mysqld_safe方式进入mysql  命令

mysqld_safe --user=mysql &

#mysql -u root

mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql>FLUSH PRIVILEGES;

重启mysql

#/etc/init.d/mysql restart

#mysql -u root -p

Enter password:

mysql远程登录授权grant命令

命令:

grant all privileges on *.* to 'USER'@'IP' identified by 'PASS' 

USER:登录用户名

PASS:密码

IP:ip地址或主机号

*.*:数据库.数据表名

all privileges:所有权限 也可为select,insert ,update,delete

整理下,以被以后遇到又浪费太多时间。

Access denied for user 'root'@'localhost' (using password:YES)的更多相关文章

  1. MySql Access denied for user 'root'@'localhost' (using password:YES) 解决方案

    关于昨天下午说的MySQL服务无法启动的问题,解决之后没有进入数据库,就直接关闭了电脑. 今早打开电脑,开始-运行 输入"mysql -uroot -pmyadmin"后出现以下错 ...

  2. phpmyadmin #1045 - Access denied for user 'root'@'localhost' (using password: NO)

    phpmyadmin访问遇到1045问题 #1045 - Access denied for user 'root'@'localhost' (using password: NO) 解决办法 找到p ...

  3. Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes

    Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes http://blog.csdn.n ...

  4. Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit ...

  5. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因

    在博客Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N ...

  6. mac 安装mysql + 修改root用户密码 + 及报Access denied for user 'root'@'localhost' (using password:YES)解决办法

    1.下载MySQL 到mysql的官网http://dev.mysql.com/downloads/mysql/然后在页面中会看到“MySQL Community Server”下方有一个“downl ...

  7. 升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...

  8. mysql 链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES))

    mysql链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)) 修改: # ...

  9. 安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的解决方案

    本机是centos 6.5  安装的mysql是5.1的版本. 在安装mysql之后,第一次启动mysql服务的时候,需要/tmp有777(rwxrwxrwx)的权限,然而楼主的/tmp是755(rw ...

随机推荐

  1. 20141203图片Base64编码与解码

    最近需要将图片通过转码的形式传给移动端,使用了Base64转码与 解码 import java.io.FileInputStream; import java.io.FileOutputStream; ...

  2. LEETCODE —— Surrounded Regions

    Total Accepted: 43584 Total Submissions: 284350 Difficulty: Medium Given a 2D board containing 'X' a ...

  3. AutoLearnSkills.lua --升级自动学习技能

    --[[作者信息: Auto Learn SKills (升级自动学习技能) 作者QQ:247321453 作者Email:247321453@qq.com 修改日期:2014-3-12 功能:在玩家 ...

  4. Storm进阶

    并行度 在Storm集群中真正运行Topology的主要有三个实体:worker.executor.task,下图是可以表示他们之间的关系. 数据流模型 对于一个Spout或Bolt,都会有多个tas ...

  5. Nginx中文域名配置

    Nginx虚拟主机上绑定一个带中文域名,比如linuxeye.中国,浏览器不能跳转. why? 因为操作系统的核心都是英文组成,DNS服务器的解析也是由英文代码交换,所以DNS服务器上并不支持直接的中 ...

  6. filesort是通过相应的排序算法

    filesort是通过相应的排序算法,将取得的数据在max_length_for_sort_data的默认值是1024. --------------------------------------- ...

  7. ArcGis 字段计算表达式写法注意事项

    在ArcGis中,经常用到字段的计算.对于复杂的字段计算,需要写代码来实现,在使用ESRI.ArcGIS.DataManagementTools.CalculateField 类时,Python代码中 ...

  8. oracle 科普

    Schem定义 A schema is a collection of database objects (used by a user.). Schema objects are the logic ...

  9. [zhuan] linux 下 wxWidgets 安装,编译

      http://blog.csdn.net/yuzhenxiong0823/article/details/7727133 wxWidgets在Linux下有wxGTK和wxX11供使用,各需要GT ...

  10. GitLab常见使用方法

    1.GitLab配置 git config --global user.name "xxx" -- 配置用户名,上传本地 repository 到服务器上的时候,在 Github ...