古いMacBook Pro (13-inch, Mid 2010)にMySQL8.0をインストール
フリーで使えるRDBと言えば、MySQLとかPostgreSQLとかがお手軽ですよね。
今回は、MySQL8.0を、いつもの古いMacBook Pro (13-inch, Mid 2010)への導入した記録です。
今回は、MySQL8.0を、いつもの古いMacBook Pro (13-inch, Mid 2010)への導入した記録です。
Homebrewを使ったインストール方法
今回もあまり悩むところはなく、素直にHomebrewでインストールします。
インストールが簡単でいいね。ただ、これも一晩以上かかるので注意が必要です。
$ brew install mysql
インストールが簡単でいいね。ただ、これも一晩以上かかるので注意が必要です。
サービスの開始
長い長い待ち時間の後、インストールが完了したら、サービスを開始します。
brew services start mysql でサービスが開始できます。
brew services start mysql でサービスが開始できます。
$ brew services start mysql ==> Tapping homebrew/services Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'... remote: Enumerating objects: 20, done. remote: Counting objects: 100% (20/20), done. remote: Compressing objects: 100% (12/12), done. remote: Total 1141 (delta 8), reused 10 (delta 8), pack-reused 1121 Receiving objects: 100% (1141/1141), 331.41 KiB | 719.00 KiB/s, done. Resolving deltas: 100% (485/485), done. Tapped 1 command (40 files, 420.4KB). ==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
パスワードの更新と初期設定
mysql_secure_installation コマンドで、パスワードの更新と初期設定をしておきます。
$ mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: y There are three levels of password validation policy: LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0 Please set the password for root here. New password: [rootのパスワードを入力します] Re-enter new password: [再度、rootのパスワードを入力します] Estimated strength of the password: 50 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!こんな感じで、初期設定完了です。
さあ、これでpython3もMySQLも使えるようになったので、何かDB操作するプログラムでも作ってみましょうかね。
学習用で使うなら、まだMacBook Pro (13-inch, Mid 2010)でも、そこそこ使えそうですね。
学習用で使うなら、まだMacBook Pro (13-inch, Mid 2010)でも、そこそこ使えそうですね。