centos7 踩坑记

107 阅读2分钟

安装nvm

curl -o- raw.githubusercontent.com/creationix/… | bash

  1. command -v nvm
  2. source ~/.bashrc
  3. nvm --version

安装vim

  1. yum -y install vim*

安装wget

  1. yum install -y wget

安装mysql8

  1. 下载安装包 yum install -y wget cd /tmp rm -f mysql80-community-release-el7-11.noarch.rpm wget mirrors.tuna.tsinghua.edu.cn/mysql/yum/m…

  2. 安装 cd /tmp yum install -y mysql80-community-release-el7-11.noarch.rpm yum clean all yum makecache

  3. 查看安装源是否成功

  1. yum 安装 MySQL 8.0

yum install -y mysql-community-server.x86_64

  1. 启动 MySQL 服务器

如果这里等太久,可按键盘的 Ctrl + c 退出来再重新执行 systemctl start mysqld systemctl status -l mysqld systemctl enable mysqld

  1. 获取 MySQL 的初始密码

grep 'A temporary password' /var/log/mysqld.log | tail -1 >/tmp/mysql-init-password.txt

cat /tmp/mysql-init-password.txt, 就会出现类似的输出

2024-05-27T10:21:07.659139Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: <qL/aF4/k5V

上面文本中最末尾的“<qL/aF4/k5V”就是 MySQL 生成的密码。

7.配置初始化

mysql_secure_installation

Enter password for user root:: 输入文件 /root/mysql-init-password.txt 里面的密码; New password::输入新密码;

Re-enter new password:: 确定新密码;

Change the password for root ?:输入 n 就行;

Remove anonymous users?:移除匿名用户,输入 y 或 Y;

Disallow root login remotely?:是否允许 root 用户远程登录,如果你希望是的话,便输入 Y 或 y,否则输入其他任意键,比如 n;

Remove test database and access to it?:是否移除测试数据库以及访问它,一般情况下输入 y 或 Y 即可;

Reload privilege tables now?:重载权限表,输入 y 或 Y 实际上相当于执行 flush privileges; 命令,从而使以上的配置立即生效,而不用重启 MySQL 服务器进程。

  1. 配置好启动mysql

systemctl restart mysqld systemctl status -l mysqld

  1. 修改访问权限,允许非本地访问,比如使用navigate访问
mysql -u root -p
use mysql;
select Host,User from user;
update user set Host='%' where User='root';
 
刷新生效
flush privileges;

  1. 开放端口相关命令

如果要开放的端口太多,嫌麻烦,可以关闭防火墙,安全性自行评估

systemctl stop firewalld.service

  1. 使用navigate测试连接

安装node

  1. nvm list-remote
  2. nvm install v18.15.0

www.cnblogs.com/yuwen01/p/1…

  1. 解决GLIBC_2.28' not found (required by node) blog.csdn.net/m0_63748493…

npm 切换淘宝源

  1. npm config set registry registry.npmmirror.com

npm config get registry

安装zlib

  1. 下载zlib-1.2.11.tar.gz

ar -zxvf zlib-1.2.11.tar.gz

cd zlib-1.2.11/

./configure --prefix=/usr/local/zlib

解决harsh错误

# if try $CC -c $CFLAGS $test.c; then
#  :
# else
  # echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
  # leave 1
# fi

没有gcc yum group install "Development Tools"

make

make check

make install

echo "/usr/local/zlib/lib" >> /etc/ld.so.conf

ldconfig -v

安装pm2

  1. npm install pm2 --location=global

安装nginx

yum install epel-release yum update

  1. yum -y install nginx

  2. service nginx start

安装unzip

  1. yum install unzip zip

安装git

  1. yum install packages.endpointdev.com/rhel/7/os/x…
  2. yum install -y git