Open scarcoco opened 4 years ago
新建数据库账户没有远程访问权限
新建数据库账户没有远程访问权限
$ netstat -apn | grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 32702/mysqld
unix 2 [ ACC ] STREAM LISTENING 822460 32702/mysqld /var/lib/mysql/mysql.sock
MariaDB 配置文件路径 /etc/my.cnf
和 /etc/my.conf.d/
目录下,如果有 bind-address = 127.0.0.1
配置,那么上面的地址则为 127.0.0.1:3306
# 开机启动
systemctl enable mariadb
# 状态
systemctl status mariadb
$ mysql -uroot -p
> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
> FLUSH PRIVILEGES;
> SELECT host, user FROM user
$ firewall-cmd --query-port=3306/tcp
$ firewall-cmd --permanent --add-port=3306/tcp
$ firewall-cmd --reload
看一下后台配置端口是否开放端口,具体参考:https://help.aliyun.com/document_detail/25471.html
参考:
之前通过 yum
安装,现在想新增 nginx-rtmp-module
模块,需要源码安装。
yum -y remove nginx
./configure \
--with-pcre=/root/download/pcre-8.44 \
--with-openssl=/root/download/openssl-1.1.1d \
--with-zlib=/root/download/zlib-1.2.11 \
--with-http_ssl_module \
--with-http_v2_module \
--add-module=/root/download/nginx-rtmp-module
adding module in /root/download/nginx-rtmp-module
+ ngx_rtmp_module was configured
creating objs/Makefile
Configuration summary
+ using PCRE library: /root/download/pcre-8.44
+ using OpenSSL library: /root/download/openssl-1.1.1d
+ using zlib library: /root/download/zlib-1.2.11
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
make
出现错误:
configure: error: Invalid C++ compiler or C++ compiler flags
make[1]: *** [/root/download/pcre-8.44/Makefile] 错误 1
解决方法:
yum install -y gcc gcc-c++
防火墙打开
$ firewall-cmd --query-port=80/tcp
$ firewall-cmd --permanent --add-port=80/tcp
$ firewall-cmd --reload
su -c 'yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm'
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum -y install ffmpeg ffmpeg-devel
ffmpeg -version
System
MariaDB
NodeJS
nvm
Python
Golang
Install
Reference: https://golang.org/doc/install?download=go1.13.4.linux-amd64.tar.gz
Add /usr/local/go/bin to the PATH environment variable
go env
可以看出go module
未开启,更多go module
可以参考 https://github.com/golang/go/wiki/Modules$GOPATH=$HOME/go
go env
获取$GOPATH
虽然为/root/go
,但是$GOPATH
为空$GOPROXY
默认为https://proxy.golang.org,direct
,但是国内很多包访问不了,可以修改此环境变量,参考:https://goproxy.io/test
main.go
的代码如下:go module
开启
go module
之后,项目目录不要求一定要在$GOPATH
目录下,任意目录下执行go mod init
即可。main.go
的代码如下:Nginx
参考:http://nginx.org/en/docs/install.html