useradd -r -s /bin/false mysql
mkdir /usr/local/mysql/mysql-files
chown mysql:mysql /usr/local/mysql/mysql-files
chmod 750 /usr/local/mysql/mysql-files
/usr/local/mysql/bin/mysqld --initialize --user=mysql
执行结果中包含临时密码
mkdir /usr/local/mysql/mysql-files
chown mysql:mysql /usr/local/mysql/mysql-files
chmod 750 /usr/local/mysql/mysql-files
/usr/local/mysql/bin/mysqld --initialize --user=mysql
执行结果中包含临时密码
2019-11-04
/usr/local/mysql/bin/mysql_ssl_rsa_setup
mkdir /var/log/mariadb
touch /var/log/mariadb/mariadb.log
chown mysql:mysql /var/log/mariadb/mariadb.log
mkdir /var/run/mariadb
chown mysql:mysql /var/run/mariadb
/usr/local/mysql/bin/mysqld_safe --user=mysql &
mkdir /var/log/mariadb
touch /var/log/mariadb/mariadb.log
chown mysql:mysql /var/log/mariadb/mariadb.log
mkdir /var/run/mariadb
chown mysql:mysql /var/run/mariadb
/usr/local/mysql/bin/mysqld_safe --user=mysql &
2019-11-04
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql.server
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
/usr/local/mysql/bin/mysql -u root -p
临时密码
mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘密码’;
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
/usr/local/mysql/bin/mysql -u root -p
临时密码
mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘密码’;
2019-11-04
关于 PHP 配置文件的补充:
1. cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
2. vim /usr/local/etc/php-fpm.conf
最后一行修改为:include=etc/php-fpm.d/*.conf
1. cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
2. vim /usr/local/etc/php-fpm.conf
最后一行修改为:include=etc/php-fpm.d/*.conf
2019-11-03
2. 添加 yum 仓库
vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
3. 安装
yum install nginx
2.4. 启动
nginx
vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
3. 安装
yum install nginx
2.4. 启动
nginx
2019-11-02
参考:http://nginx.org/en/linux_packages.html
1. 准备
yum install yum-utils
1. 准备
yum install yum-utils
2019-11-02
参考:https://dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.html
2019-11-02
1. 下载 yum 仓库
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
下载地址来自 https://dev.mysql.com/downloads/repo/yum/
2. 添加 yum 仓库
yum localinstall mysql80-community-release-el7-3.noarch.rpm
3. 安装
yum install mysql-community-server
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
下载地址来自 https://dev.mysql.com/downloads/repo/yum/
2. 添加 yum 仓库
yum localinstall mysql80-community-release-el7-3.noarch.rpm
3. 安装
yum install mysql-community-server
2019-11-02
4. 启动
systemctl start mysqld.service
5. 查看临时密码
grep ‘temporary password’ /var/log/mysqld.log
6. 连接
mysql -uroot -p
临时密码
7. 设置密码
mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘密码’;
systemctl start mysqld.service
5. 查看临时密码
grep ‘temporary password’ /var/log/mysqld.log
6. 连接
mysql -uroot -p
临时密码
7. 设置密码
mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘密码’;
2019-11-02
使用线上的 yum 仓库
1. 备份仓库
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. 下载仓库
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3. 清除缓存
yum clean all
4. 生成缓存
yum makecache
1. 备份仓库
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. 下载仓库
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3. 清除缓存
yum clean all
4. 生成缓存
yum makecache
2019-11-02
如果因为无法打开 /var/run/nginx.pid 而操作 nginx 失败,则执行 kill 进程号 后再尝试
2019-11-01
CentOS 7 的防火墙操作:
显示状态
systemctl status firewalld.service
关闭
systemctl stop firewalld.service
开机禁用
systemctl disable firewalld.service
显示状态
systemctl status firewalld.service
关闭
systemctl stop firewalld.service
开机禁用
systemctl disable firewalld.service
2019-11-01