0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Laravel8 新規作成したプロジェクトのMySQLにログインする方法

Posted at

前提

以下のコマンドを実行し、Laravel8のプロジェクトを作成していること

composer create-project laravel/laravel {プロジェクト名} "8.*" --prefer-dist

MySQLのサーバー起動

$ sudo mysql.server start

ログインコマンド実行

$ sudo mysql -u {ユーザ名} -h {ホスト名} -p

.env の初期値から特に変更していないため、ユーザ名は「root」ホスト名は「localhost」を指定
正しいパスワードを入力するとログインに成功する

$ sudo mysql -u root -h localhost -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.1.0 Homebrew

Copyright (c) 2000, 2023, 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>

エラーが発生した場合

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?