前提・実現したいこと
現在、教材を見ながらherokuに初めてのデプロイをしようとしています。
herokuにデータベースを繋げてパスを通そうとしているのですが、エラーが出るので解決したく質問させてください。
macOS Mojave
MySQL 5.7.21
Eclipse 4.6
発生している問題・エラーメッセージ
.bash_profileがあるかどうか調べるために行なっているのですが、他のコードを打ってもエラーになります。
テーブルを作成し、warファイルを作る手前の段階です。
実行 ls -a ~ 結果 ERROR 2013 (HY000): Lost connection to MySQL server during query
試したこと
実行 open -e ~/.bash_profile; 結果 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'open -e ~/.bash_profile' at line 1
実行 touch ~/.bash_profile 結果 ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 000000000 Current database: 000000000 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'touch ~/.bash_profile' at line 1
実行 set global net_write_timeout=600; 結果 ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 000000000 Current database: 000000000 ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation
初めての投稿で不慣れで恐縮ですが、不備等あればご教示ください。
よろしくお願いいたします。
(追記)herokuへの接続方法
素人で申し訳ないのですが、どのように伝えれば接続方法が伝わるか分からなかったため、一から説明させていただきます。
- herokuのアカウントの作成
- Heroku CLIツールのインストール
- Heroku上にアプリケーションの作成
heroku create notepad
heroku addons:create cleardb:ignite --app notepad
heroku config --app notepad | grep CLEARDB_DATABASE_URL
4. UTF-8 の文字コードでMySQLを利用する設定
heroku config:add CLEARDB_DATABASE_URL='mysql://(ユーザ名):(パスワード)@(ドメイン)/(データベース名)?reconnect=true&useSSL=false&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8'
5. herokuのMySQLにテーブルを作成
source /Applications/Eclipse_4.6.3.app/Contents/workspace/notepad/notepad_dump.sql ERROR 2013 (HY000): Lost connection to MySQL server during query ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 000000 Current database: 000000 Query OK, 0 rows affected (4.41 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 2 rows affected (0.18 sec) Records: 2 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 4 rows affected (0.18 sec) Records: 4 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.20 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) ERROR 1231 (42000): Variable 'character_set_client' can't be set to the value of 'NULL' Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec) Query OK, 0 rows affected (0.18 sec)
そして、パスを通そうとして今に至ります。
heroku には、どのような方法で接続したのでしょうか?
あなたの回答
tips
プレビュー