Solution to failure of MySQL startup in Ubuntu

Source: Internet
Author: User

Solution to failure of MySQL startup in Ubuntu

I found that the MySQL database on one of our Ubuntu servers is stuck. It may be a deadlock, so I tried to use the Command service mysql restart, result MySQL returns the stop/waiting status when it is stopped, and uses service mysql status to view its status. The returned result is "mysql respawn/post-start". In this way, MySQL cannot be started, then, I couldn't get up. I searched the internet for more than half an hour and couldn't find a good solution.

Finally, I saw the Ubuntu mysql configuration repair command dpkg-reconfigure mysql-server-5.1, so I tried to use this command to fix it:

Dpkg-reconfigure mysql-server-5.1

I reset the root password on the prompt page. After the configuration, mysql was started miraculously.

In the process of fixing this mysql, I will share with you a little bit about the solution to this problem.

1. After the apt-get install mysql command is used in Ubuntu, we recommend that you use the command dpkg-reconfigure to reset mysql when it cannot be started.

2. After the dpkg-reconfigure method is used to fix mysql, the mysql data user will be lost. Therefore, you have to repair the mysql DATA on your server, you can use the following command to handle the problem:

Grant all privileges on db. * TO user @ localhost identified by "pass ";

In this way, we can restore the users in your original system.

3. In Ubuntu, if the software package is installed in apt-get install mode, run the dpkg-reconfigure command when the software package encounters a problem, you can fix the original software package. In this way, you can bypass many software packages to solve the problem with half the effort.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.