Contents

Initial configuration on MySQL in MAMP

A very short memo for MySQL configuration on MAMP.

Versions:

  • MAMP: 7.2
  • MySQL: 8.0.40 (able to switch 5.7.44)

Access to MYSQL on MAMP

You need to follow the direct path in mysql command in MAMP library.

1
2
 cd /Applications/MAMP/Library/bin/
 ./mysql80/bin/mysql -u root -p

Change the mysql password

The default mysql password of MAMP is root. You can change the password on mysql commandline tool.

1
mysql > set password for root@localhost = 'your password'

Create database, load the sql dump file.

It’s the same as what we do on the mysql.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.03 sec)

Create a database.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mysql> create database 'new database name'

mysql> show databases;
+---------------------------------+
| Database                        |
+---------------------------------+
| information_schema              |
| 'new database name'             |
| mysql                           |
| performance_schema              |
| sys                             |
+---------------------------------+

mysql> quit

Load the schema and table data.

1
./mysql80/bin/mysql -u root -p 'new database name' < new_database_dump_file.sql