python

1
pyenv versions

创建虚拟环境

1
python3 -m venv envp1

进入环境

1
source nvpl/bin/activate

安装依赖

source env1/bin/activate

1
pip install -r requirements.txt

修改zshrc文件

1
open ~/.zshrc
1
source ~/.zshrc

虚拟环境

退出虚拟环境

1
deactivate

mysql

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
36
37
38
39
40
41
42
43
brew install mysql@5.7
==> Downloading https://formulae.brew.sh/api/formula.jws.json
###################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
###################################################################################################### 100.0%
Warning: mysql@5.7 has been deprecated because it is not supported upstream!
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/manifests/5.7.44_1
Already downloaded: /Users/zhouzhenzhou/Library/Caches/Homebrew/downloads/9f6ae88b4c3f3af0a19550d0e3f7f6b02975ebe97f2dbe346dfd0479fa942120--mysql@5.7-5.7.44_1.bottle_manifest.json
==> Fetching mysql@5.7
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/blobs/sha256:ca2e5c8b98bd92843578ffeae0e6280d3066a
Already downloaded: /Users/zhouzhenzhou/Library/Caches/Homebrew/downloads/7d6f51b25d6589ae36b113cfc49567c965848b0d61ab5efe2036b77a38200c24--mysql@5.7--5.7.44_1.arm64_sonoma.bottle.tar.gz
==> Pouring mysql@5.7--5.7.44_1.arm64_sonoma.bottle.tar.gz
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
mysql -uroot

mysql@5.7 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have mysql@5.7 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

For compilers to find mysql@5.7 you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"

For pkg-config to find mysql@5.7 you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql@5.7/lib/pkgconfig"

To start mysql@5.7 now and restart at login:
brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir\=/opt/homebrew/var/mysql
==> Summary
🍺 /opt/homebrew/Cellar/mysql@5.7/5.7.44_1: 321 files, 235.7MB
==> Running `brew cleanup mysql@5.7`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

数据库

1
brew services start mysql