sudo apt update
安装mysql
sudo apt install mysql-server
jdk
sudo apt install openjdk-8-jdk
新建实例root用户没有密码,需要先设置密码再进行角色切换
sudo password root
nohup启动springboot项目报错
org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
查看Java环境:echo $JAVA_HOME
,
并在/etc/environment
中添加JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
然后重启服务器或source /etc/environment
更新
启动springboot项目
nohup java -jar your_service.jar > log.txt 2>&1 &
登录MySQL服务器
mysql -u your_username -p
切换数据库
use your_database;
显示当前数据库下所有表
show TABLES
查看MySQL账户密码管理方式
SELECT User, Host, plugin FROM mysql.user;
mysql_native_password : 密码登录
auth_socket:允许无密码登录
unix_socket:允许无密码登录
更改认证方式:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';
crontab定时任务:
3 11 * * * cd /home/lighthouse/project; /root/anaconda3/envs/python39/bin/python crawl_stock.py
6 11 * * * /root/anaconda3/envs/python39/bin/python /home/lighthouse/project/PaddleNLP-develop/applications/sentiment_analysis/unified_sentiment_extraction/batch_predict.py --file_path /home/lighthouse/project/comments.txt --save_path /home/lighthouse/project/result.json --load_from_dir /home/lighthouse/project/PaddleNLP-develop/applications/sentiment_analysis/unified_sentiment_extraction/checkpoint/model_best --model uie-senta-base --schema "['情感倾向[正向,负向]']" --batch_size 2 --max_seq_len 128