LoginSignup
0
0

More than 5 years have passed since last update.

WindowsのUbuntu上でMySQLを起動する

Posted at

MySQLの起動

ここは単純にMySQLを呼び出してみます

$ mysql

#=>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

グーグル先生曰く「ソケット経由でローカルのMySQLサーバに接続できません」だそうです

今度はローカルホストを指定してみます

$ mysql -h 127.0.0.1

#=>ERROR 1045 (28000): Access denied for user 'ユーザー名'@'localhost' (using password: NO)

通信はできましたが今度はユーザー名とパスワードがないそうです
初期設定でのユーザー名のrootとパスワードを付け加えます

$ mysql -h 127.0.0.1 -u root -p

#=>Enter password:

パスワードの要求が来ました、さっそく入れてみましょう

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 8.0.12 MySQL Community Server - GPL

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をUbuntu上で起動することができました

この記事が次に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