-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMySQL on Mac
35 lines (27 loc) · 834 Bytes
/
MySQL on Mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# start mysql server process (need mac password)
cd /usr/local
cd mysql-8.3.0-macos14-arm64
cd support-files
./mysql.server stop
./mysql.server start
# log into mysql (need mysql password)
cd ..
cd bin
./mysql -u root -p
exit
# not use root user, create a new user
# log in as root first
show databases;
create database <database_name>;
use <database_name>; # swith to the designated database
show tables;
# create a new user
create user '<user_name>'@'<ip_address or domain name or localhost>' identified by '<password>';
grant all privileges on <database_name>.* to '<user_name>'@'<ip_address or domain name or localhost>'
exit
# log in as new user
./mysql -u <user_name> -p
# kill all running mysql processes
sudo killall mysqld
# change ownership of the folder to mysql user
sudo chown -R mysql mysql-8.3.0-macos14-arm64