0%

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
1.http://dev.mysql.com/downloads/repo/yum/ 地址下载相对应rpm包
2.rpm -ivh mysql57-community-release-el7-8.noarch.rpm (此时/etc/yum.reps.d/下已经有mysql地址源)
3.yum makecache
4.yum list | grep mysql(查询mysql-server)
5.yum install mysql-community-server.x86_64 进行安装
6.service mysqld restart
7.cat /var/log/mysqld.log | grep password
8.vi /etc/my.cnf ([mysqld] 下增加 validate-password=OFF 关闭密码长度等机制)
9.systemctl restart mysqld.service (重启服务)
10.mysql -uroot -p (登录mysql)
11.SET PASSWORD = PASSWORD('root');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
flush privileges;
12.
client端用户命令:
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
(GRANT <privileges> ON <what> TO <user> [IDENTIFIED BY "<password>"] [WITH GRANT OPTION];)
(
打开MYSQL:service mysqld start
关闭MYSQL:service mysqld stop
)
13.firewall-cmd --zone=public --add-port=3306/tcp --permanent (防火墙)
systemctl stop firewalld
systemctl start firewalld

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
yum install zlib-devel
yum install gcc
yum install openssl-devel

wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
xz -d Python-2.7.12.tar.xz & tar xvf Python-2.7.12.tar
tar xvf Python-2.7.12.tar
cd Python-2.7.12
./configure --with-zlib=/usr/include
make && make altinstall
cd /usr/bin
mv python python_bak
ln -s /usr/local/bin/python2.7 ./python
vi yum
cd
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
yum install m2crypto
cd
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.11.tar.gz
tar -xvf libsodium-1.0.11.tar.gz
cd libsodium-1.0.11
./configure
make && make install
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig

ssserver -c config -d start
ssserver -c config -d stop

已安装GCC
REDIS下载地址

1
2
3
4
5
6
7
8
wget http://download.redis.io/releases/redis-3.2.3.tar.gz
tar xzf redis-3.2.3.tar.gz
cd redis-3.2.3
<make (致命错误:jemalloc/jemalloc.h:没有那个文件或目录)>
make MALLOC=libc
firewall-cmd --zone=public --add-port=6379/tcp --permanent
systemctl stop firewalld
systemctl start firewalld
阅读全文 »

1
2
3
4
//导出requirements
pip freeze > requirements.txt
//导入requirements
pip install -r requirements.txt

1.Create sh script file

1
touch backup.sh

2.Copy this code and paste it into backup.sh script file

1
2
3
4
5
6
7
8
9
#bin/sh
MYSQLDUMP=YOUR_MYSQLDUMP_PATH
MYSQL_USERNAME=YOUR_MYSQL_USERNAME
MYSQL_PASSWORD=YOUR_MYSQL_PASSWORD
MYSQL_HOST=YOUR_MYSQL_HOST
MYSQL_PORT=YOUR_MYSQL_PORT
MYSQL_DB=YOUR_MYSQL_DB
SQL_NAME=${MYSQL_DB}"_""`date "+%Y%m%d%H%M%S"`"".sql"
${MYSQLDUMP} -u${MYSQL_USERNAME} -h${MYSQL_HOST} -P${MYSQL_PORT} -p${MYSQL_PASSWORD} ${MYSQL_DB} > ./${SQL_NAME}
阅读全文 »