0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MySQLのデータ保存先を変更して使えるようにする

Last updated at Posted at 2021-06-14

概要

Macでデータの保存先をハードディスクなどにした状態でMySQLに接続できるようにします。

やること

以下を記述する

/usr/local/etc/my.cnf
datadir=/Volumes/SSD_dsk/mysql

mysqlのデータを移す

$ cp -prf /usr/local/var/mysql/ /Volumes/SSD_dsk/mysql

$ mysql -u root

show variables like 'datadir';
+---------------+-------------------------+
| Variable_name | Value                   |
+---------------+-------------------------+
| datadir       | /Volumes/SSD_dsk/mysql/ |
+---------------+-------------------------+

もし動かない場合は

$ mysql.server restart

または、アクティベートする。

$ source activate base
$ mysql.server start

参考サイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?