首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法启动mySQL

问无法启动mySQL
EN

Stack Overflow用户
提问于 2012-04-10 21:28:34
回答 5查看 16.5K关注 0票数 2

即使我使用以下命令重置了超级用户密码,我也无法登录到MySQL:(列出的其他命令提供了更多信息)

代码语言:javascript
复制
    # sudo dpkg-reconfigure mysql-server-5.1

    # mysql -u root -p
    Enter password:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    # telnet 127.0.0.1 3306
      Trying 127.0.0.1...
      telnet: Unable to connect to remote host: Connection refused
    # ps -Aw |grep mysql
      26522 ?        00:00:00 mysqld

    # /etc/init.d/mysql start
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service mysql start

    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the start(8) utility, e.g. start mysql

更新:

代码语言:javascript
复制
     # sudo mysqladmin -u root password 123
     mysqladmin: connect to server at 'localhost' failed

MySQL似乎没有正常运行

更新:我使用的是Ubuntu下的MySQL 5.1。在我对my.cnf进行了一些更改以启用远程访问之前,它是可以使用的。我撤消了我的更改,但问题没有解决!(也许我忘了撤消某些事情!)

更新:

代码语言:javascript
复制
     # service mysql status
     mysql start/running, process 26650
     # /etc/init.d/mysql status
     Rather than invoking init scripts through /etc/init.d, use the service(8)
     utility, e.g. service mysql status

     Since the script you are attempting to invoke has been converted to an
     Upstart job, you may also use the status(8) utility, e.g. status mysql
     mysql start/running, process 26650
EN

回答 5

Stack Overflow用户

发布于 2012-04-10 21:33:43

要设置root密码,请执行以下操作:

代码语言:javascript
复制
 mysqladmin -u root password NEWPASSWORD

要恢复它:http://www.cyberciti.biz/tips/recover-mysql-root-password.html

票数 2
EN

Stack Overflow用户

发布于 2012-04-10 21:34:25

我最好的猜测是,如果您重新配置/重新安装了MySQL,则需要在没有密码的情况下登录,例如:

mysql -u root

甚至是

mysql

Edit:要查看服务是否正在运行,您可以尝试:

service mysqld status

如果它没有运行,请尝试:

service mysqld start然后再次检查状态。

票数 2
EN

Stack Overflow用户

发布于 2012-04-10 22:27:46

看起来MySQL肯定没有运行。您可以使用/etc/init.d/mysqld status或service mysqld status验证这一点(不要直接链接到服务命令)。

我敏锐的感觉告诉我,你的or或MySQL安装执行得不正确。了解更多关于(linux?)您正在运行的环境,以及它是如何配置的(或者是谁配置的,在PaaS的情况下)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10089748

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档