CentOS7에 MySQL 설치 후 실행할 때 발생하는 오류 잡는 방법

arizona0의 이미지

CentOS 7에서 MySQL을 사용하려고 합니다.

root 계정으로 로그인해서 다음과 같이 yum을 사용하여 mysql을 설치했습니다.

[root@node01 ~]# yum install mysql mysql-server mysql-libs mysql-devel

설치 후 mysql의 version을 확인해봤더니 다음과 같습니다.

[root@node01 ~]# mysql --version
mysql Ver 15.1 Distrib 5.5.41-MariaDB, for Linux (x86_64) using readline 5.1

그리고 mysql을 시작시켜보았습니다.

[root@node01 ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.

위와 같은 방법이 잘 안되어 아래와 같이 다시 해보았습니다.

[root@node01 ~]# systemctl start mysqld.service
Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.

모두 되지 않아서 mysqld.service를 mariadb.service로 변경해서 해보아도 되지 않습니다.

구글에서 검색해서 나오는 방법들을 모두 동원해서 my.cnf도 수정해보고 mysqld.sock도 링크해서 해보고 했지만 안됩니다.
어떻게 해결해야 할지 고수님들의 도움 바랍니다.

bushi의 이미지

mariadb.service 는 있습니다.

$ rpm -qlp <a href="http://ftp.daum.net/centos/7/os/x86_64/Packages/mariadb-server-5.5.41-2.el7_0.x86_64.rpm" rel="nofollow">http://ftp.daum.net/centos/7/os/x86_64/Packages/mariadb-server-5.5.41-2.el7_0.x86_64.rpm</a> | grep systemd
/usr/lib/systemd/system/mariadb.service

arizona0의 이미지

답변 주신 대로 rpm을 설치해보라는 말씀이신지요?

bushi의 이미지

아뇨.
전 centos 를 사용하지 않는 터라 centos 용 패키지를 실제 설치해서 확인할 수 없기 때문에,
centos 7 용 패키지에 mariadb.service 파일이 의심의 여지 없이 들어 있다는 것을 확인시켜드리기 위해 rpm 을 이용해서 remote http:// 의 것을 보여 드린 겁니다.

정말로 패키지를 잘 설치하신 게 확실하다면,
rpm -ql mariadb-server
로 나오는 파일 목록에 mariadb.service 파일이 분명이 보일 것이고,
손으로 뭘 하시다가 잘못 건드려서 망가지거나 삭제된 게 아니라면 실제 그 디렉토리에 그 파일이 존재해야 합니다.

망가지거나 없어졌는지 확인하시려면,
rpm -qV mariadb-server

service 파일이 복사됐지만, 어떤 이유에선가 systemd 가 load 를 못할 수도 있는데,
systemctl list-units -t service --all
의 목록에 mariadb.service 가 있는지 보시고요.

arizona0의 이미지

기존에 설치되어 있던 rpm들과 충돌이 발생해서 mysql server rpm이 제대로 설치가 안되었었습니다.
그래서 충돌이 일어난 rpm들을 제거하고 다시 설치를 했더니 해결되었습니다.

감사합니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.