• ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


    First make a backup of your /var/lib/mysql/ directory just to be safe.

    sudo mkdir /home/<your username>/mysql/
    cd /var/lib/mysql/
    sudo cp * /home/<your username>/mysql/ -R

    Next purge MySQL (this will remove php5-mysql and phpmyadmin as well as a number of other libraries so be prepared to re-install some items after this.

    sudo apt-get purge mysql-server-5.1 mysql-common

    Remove the folder /etc/mysql/ and it's contents

    sudo rm /etc/mysql/ -R

    Next check that your old database files are still in /var/lib/mysql/ if they are not then copy them back in to the folder then chown root:root

    (only run these if the files are no longer there)

    sudo mkdir /var/lib/mysql/
    sudo chown root:root /var/lib/mysql/ -R
    cd ~/mysql/
    sudo cp * /var/lib/mysql/ -R

    Next install mysql server

    sudo apt-get install mysql-server

    Finaly restart your server.
  • 相关阅读:
    软件对标分析
    第一阶段绩效评估
    自律小帮手:Alpha版使用说明
    团队 电梯演讲 原型展示
    意见评论
    Alpha版(内部测试版)发布
    意见汇总
    产品对比
    团队项目-第二阶段冲刺-3
    团队项目-第二阶段冲刺-2
  • 原文地址:https://www.cnblogs.com/leyton/p/4520190.html
Copyright © 2020-2023  润新知