はじめに
手ごろなDB環境を整えておきたい。かつ、XAMPPほどの機能は要らないかなという思いで、mysqlのみインストールしてみた。
簡易的に試す用途でのインストールのため、設定は適当。
Mysqlのダウンロード
こちらからインストーラをダウンロードする。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_download1-800x528.png)
Oracleのログインやサインアップはしなくても、画面下部の文字をクリックすることでダウンロードできる。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_download2-800x584.png)
Mysqlのインストール
インストーラをダブルクリックして、以下のようにインストールする。
今回はサーバーさえ用意できればいいので、「Server only」を選択。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-1.png)
ダウンロードの実行と確認。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-2.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-3.png)
インストールの実行と確認。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-4.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-5.png)
設定も基本的にはデフォルトでOK。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-6.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-7.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-8.png)
アカウント設定だけは、Root権限のパスワードを入力する必要がある。
お試し用ならrootとかでいいんじゃないかな。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-9.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-10.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-11.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-12.png)
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-13.png)
インストール完了。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_installer-14.png)
Mysqlの動作確認
管理者権限でコマンドプロンプトを起動し、以下のコマンドを入力する。
net start mysql80 mysql --version
画像のように表示されればOK。
![](https://tora-k.com/wp-content/uploads/2022/08/mysql_check-800x418.png)
mysqlコマンドでエラーが発生
「mysql –version」でエラーが出た場合、パスが通っていない可能性があります。
以下の手順でパスを通してください。
- 「システム環境変数の編集」を実行
- 「環境変数」を押下
- 「Path」を選択して「編集」を押下
- 環境変数を設定する
![](https://tora-k.com/wp-content/uploads/2022/11/image-2.png)
![](https://tora-k.com/wp-content/uploads/2022/11/image-3.png)
![](https://tora-k.com/wp-content/uploads/2022/11/image-4.png)
![](https://tora-k.com/wp-content/uploads/2022/11/image-5.png)
環境変数には「C:\Program Files\MySQL\MySQL Server 8.0\bin」を入力してください。(インストール先がデフォルトでない場合は環境に合わせてください。)
最後に
以前インストールしたnodejsと組み合わせていろいろ遊べそう。
コメント