-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
## 备份文件 | ||
- /etc/nginx/conf.d/ | ||
|
||
|
||
## 数据库直接通过开发环境生成一个dvsv3 | ||
- 1、出数据库的结构和表数据 | ||
``` | ||
mysqldump -hxxx.xxx.xxx.xxx -P4006 -uroot -pxxxxxxxx dvsv3>/usr/local/sunlight/sql/dvsv3.sql; | ||
``` | ||
|
||
- 2、在新服务器上线创建数据库 | ||
注意字符集 utf8mb4 | ||
注意排序规则 utf8mb4_general_ci | ||
``` | ||
CREATE DATABASE your_database_name | ||
CHARACTER SET utf8mb4 | ||
COLLATE utf8mb4_general_ci; | ||
``` | ||
- 3、然后导入到新数据库 | ||
``` | ||
mysql -hlocalhost -P4006 -uroot -pxxxxxxxxx dvsv3</usr/local/sunlight/sql/dvsv3.sql | ||
``` | ||
|
||
## 修改数据库连接 | ||
- /usr/local/sunlight/dvsv3/etc | ||
|
||
## 修改redis连接 | ||
|
||
## nginx配置文件 | ||
|
||
``` | ||
/etc/nginx/conf.d | ||
``` | ||
|
||
## 系统服务配置文件 | ||
``` | ||
/usr/lib/systemd/system | ||
``` | ||
|
||
## rabbitmq | ||
``` | ||
// 配置文件路径 | ||
/etc/rabbitmq/rabbitmq.config | ||
// RabbitMQ 管理页面 用户名和密码 | ||
http://localhost:15675/#/ | ||
// 通过命令可以查看用户 | ||
sudo rabbitmqctl list_users | ||
sun sunlight2010 | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
## mysql查看死锁 解除死锁 | ||
- https://blog.csdn.net/wufagang/article/details/125554792 | ||
|
||
- 查看死锁 | ||
|
||
``` | ||
1、查看正在进行中的事务 | ||
SELECT * FROM information_schema.INNODB_TRX | ||
2、查看正在锁的事务 | ||
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; | ||
3、查看等待锁的事务 | ||
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS; | ||
4、查询是否锁表 | ||
SHOW OPEN TABLES where In_use > 0; | ||
在发生死锁时,这几种方式都可以查询到和当前死锁相关的信息。 | ||
5、查看最近死锁的日志 | ||
show engine innodb status | ||
``` | ||
|
||
|
||
- 解除死锁 | ||
``` | ||
show processlist; | ||
SELECT * FROM information_schema.INNODB_TRX; | ||
//查询出来后 杀死进程 | ||
kill id | ||
// 杀完再来验证一下 | ||
SHOW OPEN TABLES where In_use > 0; | ||
```` |