通过mysql -u用户名 -p密码 的命令连接 Mysql数据库时

报错 "can't connect to local mysql serverthrough  socket'/var/run/mysqld/mysqld.sock'

 mysql -u root -p
Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

解决方法:

在不重新安装mysql的情况下,通过如下命令来解决,具体的就是先停止mysql服务,再重新开启mysql服务

cd /etc/init.d

sudo service mysql stop

sudo service mysql start 

执行后便可以启用mysql数据库

启动 mysql 时报错的更多相关文章

  1. 第一次启动MySQL时报错

    [root@localhost~]#/usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mys ...

  2. Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with

    Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with 摘要 Li ...

  3. MyEclipse 启动tomcat时报错:Cannot change deployment state from ERROR to REDEPLOYING.ds

    myeclipse 启动tomcat时报错:Cannot change deployment state from ERROR to REDEPLOYING.ds - 刘琦的专栏 - 博客频道 - C ...

  4. 启动Mysql报错:Another MySQL daemon already running with the same unix socket.

    启动Mysql报错: Another MySQL daemon already running with the same unix socket. 删除如下文件即可解决 /var/lib/mysql ...

  5. 启动MySQL报错

    安装完MySQL,启动MySQL报错,报错信息如下:Starting MySQL....The server quit without updating PID file (/data/mysqlda ...

  6. 用Eclipse的tomcat插件启动tomcat时报错:

    用Eclipse的tomcat插件启动tomcat时报错: FATAL ERROR in native method: JDWP No transports initialized, jvmtiErr ...

  7. Ubuntu 16.04.3启动MySQL报错

    今天安装mysql,连接MySQL时报错mysql: [Warning] Using a password on the command line interface can be insecure. ...

  8. 【转载】在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support

    在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone config ...

  9. 【原创】大叔经验分享(57)hue启动coordinator时报错

    hue启动coordinator时报错,页面返回undefinied错误框: 后台日志报错: runcpserver.log [13/May/2019 04:34:55 -0700] middlewa ...

随机推荐

  1. base64图片

    常见的html中或css中图片的src赋值为data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHR ...

  2. android 开发 View _7_ 动态自定义View

    效果图: 代码: package com.example.lenovo.mydemo.myViewDemo; import android.content.Context; import androi ...

  3. 游戏搭服自动化脚本shell

    #!/bin/bash #;g=6006c= 178pop_s10 rm-bp1gy2r82o607w4v8.mysql.rds.aliyuncs.com # basedir=/data/jzadmi ...

  4. Linux输入子系统详解

    input输入子系统框架  linux输入子系统(linux input subsystem)从上到下由三层实现,分别为:输入子系统事件处理层(EventHandler).输入子系统核心层(Input ...

  5. i386 x86_64 armv7 arm64

    arm7: Used in the oldest iOS 7-supporting devices arm7s: As used in iPhone 5 and 5C arm64: For the 6 ...

  6. JDK Timer & TimerTask

    目录 Timer & TimerTask Binary Heap Insert DELETE MIN PERFORMANCE LifeCycle Constructor MainLoop sc ...

  7. [Shell]Bash变量:数值运算及运算符

    ------------------------------------------------------------------------------------------------- Sh ...

  8. push() 方法将一个或多个元素添加到数组的末尾,并返回新数组的长度

    var numbers = [1, 2, 3]; numbers.push(4); console.log(numbers); // [1, 2, 3, 4] numbers.push(5, 6, 7 ...

  9. Beta冲刺——第二天

    beat冲刺:第二天 各个成员今日完成的任务 成员 冯晓.马思远 彭辉.王爽 吴琼.郝延婷 今日完成任务 ·管理员功能模块的代码规范与测试 ·网站的前端调整 ·代码规范 ·系统管理模块功能测试 ·博客 ...

  10. xadmin增加用户 除了账号和密码 添加其他信息

    默认xadmin在添加账号的时候只有账号和密码 我们可以添加其他信息 打开源码 xadmin -> plugins -> auth -> 找到self.form = UserCrea ...