MariaDBインストールからMySQLWorkbenchを使用できるようにするまで
MariaDBインストールから設定まで
HomebrewでMariaDBをインストール
最新をいれます。バージョンを指定したい場合はmariadb@10.4などにする
arch -arm64 brew install mariadb
PATHを通す
~/.zshrcに以下を追加
#mariadbを使うpath
export PATH=/opt/homebrew/opt/mariadb/bin:$PATH
mariadbは自動起動する
brew services start mariadb
mysql_secure_installationでセキュリティ関連の設定を行う
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
上記エラーでログインできないときはsudoをつけると入れる
mysql_secure_installation
//エラーがでる場合はこちら
sudo mysql_secure_installation
Yesで進めていく
Switch to unix_socket authentication [Y/n]
Change the root password? [Y/n]
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
MySQLサーバーを起動してみる
mysql.server start
MySQLWorkbenchのインストールから設定まで
こちらからmacOSをインストール
OSのユーザー名とmariadbのユーザー名が同一でないと動かないため、Edit Connectionから以下の設定をする
Connection Method: Local Socket/Pipe
Socket/Pipe Path: /tmp/mysql.sock
Username: Macのユーザー名入れてください