Failed to start mysql.service: Unit mysql.service is masked.

jicky huang Lv5

If you encounter the error “Failed to start mysql.service: Unit mysql.service is masked.”, you can try the following steps to fix it.

This typically happens when mysql.service is linked to /dev/null.

  1. Remove old database setup:

    1
    rm -r /var/lib/mysql*
  2. Install a new database system:

    1
    mysql_install_db -u mysql
  3. Unmask the service:
    This will re-enable the service for systemd.

    1
    systemctl unmask mysql.service
  4. Start the service:

    1
    service mysql start
  • 标题: Failed to start mysql.service: Unit mysql.service is masked.
  • 作者: jicky huang
  • 创建于 : 2016-03-06 12:56:44
  • 更新于 : 2025-10-05 20:36:03
  • 链接: https://www.hxfund.cn/2016/03/06/failed-to-start-mysql-service-unit-mysql-service-is-masked/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
Failed to start mysql.service: Unit mysql.service is masked.