zoukankan      html  css  js  c++  java
  • MySQL无法启动重启竟是因为改了Linux主机名

    MySQL无法重启、无法关闭、无法启动、无法使用,如果是因为修改了主机名,可以这样解决:关闭掉所有mysql进程,然后在启动一些mysql!

    有时候,只要执行如下MySQL初始化命令即可解决:/usr/local/mysql/bin/mysql_install_db--user=mysql

    今天无事看到自己的主机名不对,于是改了一下,以便区分服务器,那只重启mysql时出现下面错误:

    MySQL manager or server PID file could not be found!       [FAILED]
    Starting MySQL.Manager of pid-file quit without updating fi[FAILED]

    怎么会找不到PID呢,看下面:

    [root@daban114.com ~]#  ps aux | grep mysql
    mysql    16433  0.0  0.2  36636  5756 ?        Sl   15:07   0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --log-error=/usr/local/mysql/var/hao9goAndSecondWeb.err --pid-file=/usr/local/mysql/var/hao9goAndSecondWeb.pid --socket=/tmp/mysql.sock --port=3306
    root     16992  0.0  0.0   4020   704 pts/0    S+   15:11   0:00 grep mysql

    原来PID还是原来主机名.pid,运行:

    kill -9 <mysqlpid> 然后 service mysql start 哈哈看到绿色的OK了,

    [root@daban114 ~]# service mysql start
    Starting MySQL.                                            [ OK  ]

  • 相关阅读:
    101. Symmetric Tree(js)
    100. Same Tree(js)
    99. Recover Binary Search Tree(js)
    98. Validate Binary Search Tree(js)
    97. Interleaving String(js)
    96. Unique Binary Search Trees(js)
    95. Unique Binary Search Trees II(js)
    94. Binary Tree Inorder Traversal(js)
    93. Restore IP Addresses(js)
    92. Reverse Linked List II(js)
  • 原文地址:https://www.cnblogs.com/crxis/p/8473443.html
Copyright © 2011-2022 走看看