前提・実現したいこと
初質問、初心者でございます。
分かりづらい点などあると思いますが、よろしくお願いします。
前回の質問内容
mac版VScodeでruby on rails を使用してwebアプリを作成しようとしています。
その際データベースを使用したいので、VScode内で作成したデータベースを表示したいです。
今回の質問内容(追記)
ターミナルにて
sql
1$rails g model Test3 test:text
と入力しモデル、テーブルを作成しましたが、これがどのデータベース内に表示されているのかが分かりません。
これを自分が指定したデータベース内に作成したいです。
発生している問題・エラーメッセージ【前回の内容】
【前回の内容】
VScode内でMySQLをダウンロードすると左側に出てきた「database explorer」をクリックし、
Connect to Database Server
画面にて各入力項目を入力すると(添付写真参照)
Connection error! Access denied for user 'hiro'@'localhost' (using password: YES)
とのエラーメッセージが出て、接続ができません。
①これらの項目に何を入力すればよいのか
②そもそもこれを行う以前に準備するべきことがあるのか
③現在作成しているターミナル上で
$ rails g model Test3 test:text
を実行したが、このデータベースはどこで確認できるのか
これらをお聞きしたいです。
該当のソースコード
sql
1 2 ーーーーーーー追記ーーーーーーー 3FindRoom_app % mysql --user=root --password 4Enter password: 5Welcome to the MySQL monitor. Commands end with ; or \g. 6Your MySQL connection id is 38 7Server version: 5.7.32 Homebrew 8 9Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. 10 11Oracle is a registered trademark of Oracle Corporation and/or its 12affiliates. Other names may be trademarks of their respective 13owners. 14 15Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 16ーーーーーーー追記終わりーーーーーーー 17 18mysql> SHOW databases; 19+--------------------+ 20| Database | 21+--------------------+ 22| information_schema | 23| list_app | 24| mysql | 25| performance_schema | 26| sys | 27+--------------------+ 285 rows in set (0.00 sec) 29
ターミナル $ rails g model Test3 test:text Running via Spring preloader in process 40595 invoke active_record create db/migrate/20210513083845_create_test3s.rb create app/models/test3.rb invoke test_unit create test/models/test3_test.rb create test/fixtures/test3s.yml
試したこと
前回の内容
MySQLをmacのターミナルからインストールしたときのパスワード、PCのパスワード、パスワードなしを入力しました。
様々なサイトを調べましたが、どのサイトも接続時に入力する内容(ユーザー名、host名など)が具体的に記載されておらず、接続できませんでした。
今回の内容(追記)
現在存在する
information_schema
list_app
mysql
performance_schema
sys
の5つのデータベース内を確認しましたが、Test3のテーブルは存在しませんでした。
補足情報(FW/ツールのバージョンなど)
gemファイル
ruby '2.6.3'
'rails', '> 6.1.3', '>= 6.1.3.2'> 1.4'
'sqlite3', '
'puma', '> 5.0'> 5.0'
'sass-rails', '>= 6'
'webpacker', '
'turbolinks', '> 5'> 2.7'
'jbuilder', '
'bootsnap', '>= 1.4.4', require: false
'byebug', platforms: [:mri, :mingw, :x64_mingw]
'web-console', '>= 4.1.0'
'rack-mini-profiler', '> 2.0'> 3.3'
'listen', '
'spring'
'capybara', '>= 3.26'
'selenium-webdriver'
'webdrivers'
'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
"racc" , "1.5.2"
回答3件
あなたの回答
tips
プレビュー