Linux 常用命令笔记
# 上传到云服务器
scp -r ~/Projects/xxx/xxx root@ip:/var/www/html
# 移到文件
mv source/path target/path
# 删除文件
rm -rf path
# 查看端口占用情况
netstat -ntlp
# 杀掉进程
kill xxxx
# 重启 Nginx
sudo systemctl restart nginx
# 允许 SSH 端口
ufw allow 22/tcp
# 开放 FTP 被动模式端口(示例)
ufw allow 50000:50010/tcp
# 重启防火墙生效
ufw reload
mysqladmin flush-hosts -u [username] -p
**** [MySQL password]
MySql 重置密码及修改端口号(Ubuntu)
sudo apt update
sudo apt install mysql-server -y
sudo systemctl status mysql
sudo systemctl stop mysql
# 杀掉跳过验证的进程
sudo killall -9 mysqld
sudo systemctl start mysql
-- 注意:将 '你的新密码' 换成你想设的密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的新密码';
-- 刷新内存中的权限
FLUSH PRIVILEGES;
-- 退出
EXIT;
修改端口号
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
sudo systemctl restart mysql
sudo ss -tlnp | grep mysql
# 设置防火墙规则
sudo ufw allow 3307/tcp
# Mac 测试工具
nc -zv 你的服务器IP 3307
[mysqld]
port = 3307
bind-address = 0.0.0.0 # 如果需要远程访问,确保这一行也是开启的
mysql -u root -p -e "SHOW VARIABLES LIKE 'port';"
UPDATE mysql.user SET host = '%' WHERE user = 'root' AND host = 'localhost';
FLUSH PRIVILEGES;
Nginx
sudo apt update
sudo apt install nginx -y
systemctl status nginx
sudo apt install php-fpm php-mysql -y
# 默认加载的是 sites-enabled 里面的规则,注释掉就可以了
include /etc/nginx/conf.d/*.conf;
# include /etc/nginx/sites-enabled/*;
安装 java 并开启防火墙
sudo apt install openjdk-17-jdk -y
感谢您的阅读,如果您对我的文章感兴趣,可以关注我的博客,我是叙帝利,下篇文章再见!
高颜值的渐变编辑器组件,支持所有 CSS 渐变语法 https://github.com/acrodata/gradient-picker
一款小而美的颜色选择器组件 https://github.com/acrodata/color-picker
低代码平台必备轻量级 GUI 库 https://github.com/acrodata/gui
适用于 Angular 的 CodeMirror 6 组件 https://github.com/acrodata/code-editor
适用于 Angular 的水印组件(防删除,盲水印) https://github.com/acrodata/watermark
支持拖拽和缩放的弹窗组件 https://github.com/acrodata/rnd-dialog
开发低代码平台的必备拖拽库 https://github.com/ng-dnd/ng-dnd
基于 Angular Material 的中后台管理框架 https://github.com/ng-matero/ng-matero
Angular Material Extensions 扩展组件库 https://github.com/ng-matero/extensions
Unslider 轮播图插件纯 JS 实现 https://github.com/nzbin/unsliderjs
仿 Windows 照片查看器插件 https://github.com/nzbin/photoviewer
仿 Windows 照片查看器插件 jQuery 版 https://github.com/nzbin/magnify
完美替代 jQuery 的模块化 DOM 库 https://github.com/nzbin/domq
简化类名的轻量级 CSS 框架 https://github.com/nzbin/snack
与任意 UI 框架搭配使用的通用辅助类 https://github.com/nzbin/snack-helper
单元素纯 CSS 加载动画 https://github.com/nzbin/three-dots
有趣的 jQuery 卡片抽奖插件 https://github.com/nzbin/CardShow
悬疑科幻电影推荐 https://github.com/nzbin/movie-gallery
锻炼记忆力的小程序 https://github.com/nzbin/memory-stake

浙公网安备 33010602011771号