본문 바로가기

database

[Mysql] 우분투 DB 설치

최신 버전 설치를 위한 서버 업데이트

# apt-get update

Tip

apt-get update -> 패키지들의 최신 버전 정보 업데이트 ex) $ :: mysql은 2021년 버전까지 나와있음!

apt-get upgrade -> 패키지 최신 패키지로 업그레이드 ex $ :: mysql을 2021년 버전으로 업그레이드 하겠음!

 

 

mysql설치

# apt-get install mysql-server

# mysql --version
mysql  Ver 8.0.25-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

 

보안설정

# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

 

 

issue, WSL은 systemctl을 지원하지 않는다고 한다.

https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-database

 

Add or connect a database with WSL

Learn how to set up MySQL MongoDB, PostgreSQL, SQLite, Microsoft SQL Server, or Redis on the Windows Subsystem for Linux.

docs.microsoft.com

 

따라서 mysql 서버를 시동하고자

# /etc/init.d/mysql start

# mysql_secure_installation

# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.25-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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>

성공