LoginSignup
0
0

More than 5 years have passed since last update.

Ubuntu 16.04 にMySQLをインストール || 少しハマったよバージョン

Last updated at Posted at 2018-07-04

:construction: まずは自身の使っている環境をご確認ください

Debian


$ cat /etc/debian_version

CentOSとかRedHatとか


$ cat /etc/redhat-release

fedora


$ cat /etc/fedora-release

★Ubuntu ← 対象!


$ cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"

UbuntuにMySQLをインストールしてみよう!


$ sudo apt update
$ sudo apt install mysql-server mysql-client

感想


至極単純明快!いいね!!!

完了かと思いきや、、、

$mysql -u xxx -p
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

なんと!

UbuntuにインストールしたMySQLを起動してみよう!

deamonはいますかー?


ps aux | grep mysqld

いるじゃないか、、、

再起動してみよう


$ /etc/init.d/mysql stop
$ rm -f /var/run/mysqld/mysqld.sock
$ rm -f /tmp/mysql.sock
$ /etc/init.d/mysql start
$ mysql -u xxx -p

ダメじゃないか、、、

再起動も試してみよう ↑と同じだけど


$ /etc/init.d/mysql restart
$ mysql -u xxx -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.22-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

いけるんかい!

再度、感想


答えが出なくてごめんなさい、、、

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0