Mbp使用记录
没忍住下手了,各种不习惯
平时也都没有用电脑的习惯了,突然要开电脑真的还不太适应
配置一下开发环境
1、安装Java
Zulu JDK,筛选System,找到需要的版本,选择ARM版dmg文件下载
https://www.azul.com/downloads/?package=jdk
安装后
~ % java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (Zulu 8.58.0.13-CA-macos-aarch64) (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (Zulu 8.58.0.13-CA-macos-aarch64) (build 25.312-b07, mixed mode)
~ % export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
2、MAVEN配置
下载maven,选择Binary文件下载
https://maven.apache.org/download.cgi#
安装后解压移动到/opt目录(此处重命名为maven)
~ % export MAVEN_HOME=/opt/maven
~ % echo $MAVEN_HOME
/opt/maven
~ % export PATH=$PATH:$MAVEN_HOME/bin
~ % echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/maven/bin
~ % mvn -version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /opt/maven
Java version: 1.8.0_312, vendor: Azul Systems, Inc., runtime: /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "12.0.1", arch: "aarch64", family: "mac"
3、安装Docker
选择 [Mac with Apple chip]
https://docs.docker.com/desktop/mac/install/
然后打开注册/登录账号(好像也可以不用?)
先安装个Mysql5.7(官方的不支持m1)
~ % docker pull mysql/mysql-server:5.7
~ % docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql/mysql-server:5.7
~ % docker exec -it mysql bash
bash-4.2 mysql -uroot -p123456
mysql> CREATE USER 'root'@'%' IDENTIFIED BY '123456';# BY后面这个才是外部访问时候root的密码
Query OK, 0 rows affected (0.03 sec)
mysql> GRANT ALL ON *.* TO 'root'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
4、数据库软件
AppStore里下了个Sequel Ace
输入信息,连接127.0.0.1/3306/root/123456
成功连接