首页 文章 精选 留言 我的

精选列表

搜索[基础搭建],共10000篇文章
优秀的个人博客,低调大师

使用ECS和mysql搭建mysql服务器

一、首先得在阿里云等云主机上申请两台主机 二、现在连上去安装mysql 1、通过安装源将mysql下载下来 [root@iz2ze2llim71y07x3numlbz ~]# wget 'https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm' --2018-03-26 16:52:00-- https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm 正在解析主机 dev.mysql.com (dev.mysql.com)... 137.254.60.11 正在连接 dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 302 Found 位置:https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm [跟随至新的 URL] --2018-03-26 16:52:02-- https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm 正在解析主机 repo.mysql.com (repo.mysql.com)... 104.127.195.16 正在连接 repo.mysql.com (repo.mysql.com)|104.127.195.16|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:25680 (25K) [application/x-redhat-package-manager] 正在保存至: “mysql57-community-release-el7-11.noarch.rpm” 2、将源里面的信息读取出来 [root@iz2ze2llim71y07x3numlbz ~]# rpm -Uvh mysql57-community-release-el7-11.noarch.rpm 警告:mysql57-community-release-el7-11.noarch.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:mysql57-community-release-el7-11 ################################# [100%] 3、安装mysql 方法一:安装下载包 [root@iz2zeap06av7ci1sytmil8z ~]# ls mysql57-community-release-el7-11.noarch.rpm [root@iz2zeap06av7ci1sytmil8z ~]# yum -y install mysql57-community-release-el7-11.noarch.rpm 已加载插件:fastestmirror 正在检查 mysql57-community-release-el7-11.noarch.rpm: mysql57-community-release-el7-11.noarch mysql57-community-release-el7-11.noarch.rpm 将被安装 正在解决依赖关系 方法二:直接安装最新的服务器版本 [root@iz2ze2llim71y07x3numlbz ~]# yum -y install mysql-community-server 已加载插件:fastestmirror base | 3.6 kB 00:00 epel | 4.7 kB 00:00 extras | 3.4 kB 00:00 mysql-connectors-community | 2.5 kB 00:00 4、安装完毕 已安装: mysql-community-libs.x86_64 0:5.7.21-1.el7 mysql-community-libs-compat.x86_64 0:5.7.21-1.el7 mysql-community-server.x86_64 0:5.7.21-1.el7 作为依赖被安装: libaio.x86_64 0:0.3.109-13.el7 mysql-community-client.x86_64 0:5.7.21-1.el7 mysql-community-common.x86_64 0:5.7.21-1.el7 替代: mariadb-libs.x86_64 1:5.5.56-2.el7 完毕! 5、启动mysql [root@iz2ze2llim71y07x3numlbz ~]# service mysqld start Redirecting to /bin/systemctl start mysqld.service [root@iz2ze2llim71y07x3numlbz ~]# 6、查看是否已经启动了(如下就是已经启动了) [root@iz2ze2llim71y07x3numlbz ~]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since 一 2018-03-26 17:03:05 CST; 50s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 10570 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 10497 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 10575 (mysqld) CGroup: /system.slice/mysqld.service └─10575 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/my... 3月 26 17:02:57 iz2ze2llim71y07x3numlbz systemd[1]: Starting MySQL Server... 3月 26 17:03:05 iz2ze2llim71y07x3numlbz systemd[1]: Started MySQL Server. 7、查看初始密码 [root@iz2zeap06av7ci1sytmil8z ~]# grep "password" /var/log/mysqld.log 2018-03-26T09:03:00.568391Z 1 [Note] A temporary password is generated for root@localhost: qAC(+wqJp8dA [root@iz2ze2llim71y07x3numlbz ~]# 8、修改密码 [root@iz2ze2llim71y07x3numlbz ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.21 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 9、修改密码设置规则 mysql> set global validate_password_policy=0; Query OK, 0 rows affected (0.00 sec) 10、设置密码 mysql> SET PASSWORD FOR 'root'@'localhost' = 'hello123456'; Query OK, 0 rows affected (0.00 sec) 11、接下来就可以远程连接了

优秀的个人博客,低调大师

Android 快应用环境搭建(Windows和Mac通用)

快应用官网 快应用官方文档 1. 安装Node.js 图1.png 尽量按照官网推荐的来安装对应包。 查看Node.js版本 node -v 图2.png 2. 安装hap-toolkit # npm设置国内镜像 npm config set registry https://registry.npm.taobao.org # npm查看镜像 npm config get registry # 通过npm仓库安装 npm install -g hap-toolkit # 验证是否安装成功 hap -V 图3.png 3. 资源下载 下载调试器和预览版工具 图4.png 4. 创建项目 创建项目hap init <ProjectName> hap init HelloWorld 图5.png 项目根目录主要结构如下: ├── sign rpk包签名模块 │ └── debug 调试环境 │ ├── certificate.pem 证书文件 │ └── private.pem 私钥文件 ├── src │ ├── Common 公用的资源和组件文件 │ │ └── logo.png 应用图标 │ ├── Demo 页面目录 │ | └── index.ux 页面文件,可自定义页面名称 │ ├── app.ux APP文件,可引入公共脚本,暴露公共数据和方法等 │ └── manifest.json 项目配置文件,配置应用图标、页面路由等 └── package.json 定义项目需要的各种模块及配置信息 安装npm依赖-进入项目的根目录再执行命令 npm install 手动编译项目 npm run build 自动编译项目 npm run watch 5. 安装应用 扫码安装 # 开启Http服务器 npm run server # 自定义端口的Http服务器 npm run server -- --port 8080

优秀的个人博客,低调大师

CentOS系列之简单搭建ftp服务器

注:以下全部是以CentOS 6为例 # 如果有需要的小伙伴可以将yum源转换到国内可以将以下shell粘贴带命令行等待执行结果 cd /etc/yum.repos.d mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget http://mirrors.163.com/.help/CentOS6-Base-163.repo yum clean all yum makecache 1、安装vsftp和ftp(可安可不安) # 安装vsftp,ftp yum install vsftp # ftp 可不安装,不影响 yum install ftp 2、创建ftp所需要的用户 #添加组 groupadd -g 1002 vsftpd #创建用户组目录 mkdir -p /home/vsftpd #添加用户 useradd -c "FTP User" -d /home/vsftpd/vsftpd -g vsftpd -s /sbin/nologin -u 1002 vsftpd useradd -c "FTP User" -d /home/vsftpd/test -g vsftpd -s /sbin/nologin test #设置密码(格式:passswd 用户名),输入密码回车,再次输入密码回车 passwd vsftpd passwd test #创建指定访问目录 mkdir -p /data/vsftpd mkdir -p /data/test #更改权限 chown vsftpd:vsftpd /data/vsftpd chown vsftpd:vsftpd /data/test chmod -R 775 /data/vsftpd chmod -R 775 /data/test 注:以后想添加用户可以以这为摸版进行创建 3、可以查看添加进来的新用户 cat /etc/passwd #如下 # vsftpd:x:1002:1002:FTP User:/home/vsftpd/vsftpd:/sbin/nologin # test:x:1003:1002:FTP User:/home/vsftpd/test:/sbin/nologin 注:/bin/false跟/sbin/nologin的区别! 1、/bin/false什么也不做只是返回一个错误状态,然后立即退出。将用户的shell设置为/bin/false,用户会无法登录,并且不会有任何提示。 2、/sbin/nologin会礼貌的向用户显示一条信息,并拒绝用户登录:This account is currently not available. 3、有一些软件,比如一些ftp服务器软件,对于本地非虚拟账户,只有用户有有效的shell才能使用ftp服务。这时候就可以使用/sbin/nologin使用户即不能登录系统,还能使用一些系统服务,比如ftp服务。/bin/false则不行,这是二者的重要区别之一 4、修改配置文件 #备份原文件 mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.txt #生成新的配置文件 touch /etc/vsftpd/vsftpd.conf #编辑配置文件 vim /etc/vsftpd/vsftpd.conf 4.1、粘贴下面这些配置到vsftpd.conf # Example config file /etc/vsftpd/vsftpd.conf # # The default compiled in settings are fairly paranoid. This sample file # loosens things up a bit, to make the ftp daemon more usable. # Please see vsftpd.conf.5 for all compiled in defaults. # # READ THIS: This example file is NOT an exhaustive list of vsftpd options. # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's # capabilities. # # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=NO # # Uncomment this to allow local users to log in. local_enable=YES # # Uncomment this to enable any form of FTP write command. write_enable=YES # # Default umask for local users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) local_umask=022 # # Uncomment this to allow the anonymous FTP user to upload files. This only # has an effect if the above global write enable is activated. Also, you will # obviously need to create a directory writable by the FTP user. #anon_upload_enable=YES # # Uncomment this if you want the anonymous FTP user to be able to create # new directories. #anon_mkdir_write_enable=YES # # Activate directory messages - messages given to remote users when they # go into a certain directory. dirmessage_enable=YES # # The target log file can be vsftpd_log_file or xferlog_file. # This depends on setting xferlog_std_format parameter xferlog_enable=YES # # Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES # # If you want, you can arrange for uploaded anonymous files to be owned by # a different user. Note! Using "root" for uploaded files is not # recommended! #chown_uploads=YES #chown_username=whoever # # The name of log file when xferlog_enable=YES and xferlog_std_format=YES # WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log #xferlog_file=/var/log/xferlog # # Switches between logging into vsftpd_log_file and xferlog_file files. # NO writes to vsftpd_log_file, YES to xferlog_file xferlog_std_format=YES # # You may change the default value for timing out an idle session. #idle_session_timeout=600 # # You may change the default value for timing out a data connection. #data_connection_timeout=120 # # It is recommended that you define on your system a unique user which the # ftp server can use as a totally isolated and unprivileged user. #nopriv_user=ftpsecure # # Enable this and the server will recognise asynchronous ABOR requests. Not # recommended for security (the code is non-trivial). Not enabling it, # however, may confuse older FTP clients. #async_abor_enable=YES # # By default the server will pretend to allow ASCII mode but in fact ignore # the request. Turn on the below options to have the server actually do ASCII # mangling on files when in ASCII mode. # Beware that on some FTP servers, ASCII support allows a denial of service # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd # predicted this attack and has always been safe, reporting the size of the # raw file. # ASCII mangling is a horrible feature of the protocol. ascii_upload_enable=YES ascii_download_enable=YES # # You may fully customise the login banner string: #ftpd_banner=Welcome to blah FTP service. # # You may specify a file of disallowed anonymous e-mail addresses. Apparently # useful for combatting certain DoS attacks. #deny_email_enable=YES # (default follows) #banned_email_file=/etc/vsftpd/banned_emails # # You may specify an explicit list of local users to chroot() to their home # directory. If chroot_local_user is YES, then this list becomes a list of # users to NOT chroot(). chroot_local_user=NO chroot_list_enable=YES # (default follows) chroot_list_file=/etc/vsftpd/chroot_list # # You may activate the "-R" option to the builtin ls. This is disabled by # default to avoid remote users being able to cause excessive I/O on large # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume # the presence of the "-R" option, so there is a strong case for enabling it. #ls_recurse_enable=YES # # When "listen" directive is enabled, vsftpd runs in standalone mode and # listens on IPv4 sockets. This directive cannot be used in conjunction # with the listen_ipv6 directive. listen=YES # # This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6 # sockets, you must run two copies of vsftpd with two configuration files. # Make sure, that one of the listen options is commented !! #listen_ipv6=YES pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES 5、设置FTP用户信息 #建立限制用户访问目录的空文件 touch /etc/vsftpd/chroot_list #添加ftp用户进来 vim /etc/vsftpd/user_list #注释掉上面的用户,在后面加上 vsftpd test #创建日志文件 mkdir -p /var/log/vsftpd mkdir -p /var/log/test touch /var/log/vsftpd/xferlog touch /var/log/vsftpd/vsftpd.log touch /var/log/vsftpd/test.log 6、处理防火墙 # 查看防火墙是否有端口,有就退出编辑,没有就执行下句 vim /etc/sysconfig/iptables #添加端口 -A INPUT -p tcp -m state --state NEW -m tcp --dport 20000:30000 -j ACCEPT #保存 /etc/init.d/iptables save #另外需要注意,如果是阿里云的,还需要登录阿里云在安全组里面添加入方向规则 #重启iptables 服务 service iptables restart 7、重启vsftpd服务 #停止vsftpd 服务 service vsftpd stop #启动vsftpd 服务 service vsftpd start #重启vsftpd 服务 service vsftpd restart 1 2 3 4 5 6 8、测试 8.1、在浏览器中 8.2、在pycharm中测试

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册