joelin109 / blog

0 stars 0 forks source link

Util: Setup For MySQL & PostgreSQL #3

Open joelin109 opened 7 years ago

joelin109 commented 7 years ago

MySQL


download `MySQL Community Server`  from http://www.mysql.com/downloads/

install mysql-5.*-osx*-1-x86_64.dmg
Alert `MySQL installer` including  temporary password during installing

then you will see `MySQL` pane in `System Preferences`
download `MySQL Workbench`  from http://dev.mysql.com/downloads/workbench/

install mysql-workbench-*.dmg

open `MySQL Workbench`,  add one `MySQL Connection`

then need update default password for root User.  
make sure that `Test Connection`  can work well
joelin109 commented 2 years ago

PostgreSQL

Move to /Applications


- Setting PATH for `Postgres`

sudo vi .zshrc

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/14/bin


<br>
<br>

- Basic Command
`psql` `which psql` `\du` `\l` `

\q - su postgres - psql (switch to other admin user)

\du alter user postgres with password 'XXXXXX'; create user user1 with password '123456'; drop user user1;

\l create database db1; drop database db1;