root

linux下安装MY SQL 与 修改 root远程登陆

被刻印的时光 ゝ 提交于 2020-01-15 08:44:07
1、配置YUM源 在MySQL官网中下载YUM源rpm安装包:http://dev.mysql.com/downloads/repo/yum/ MySQL YUM源下载地址 下载mysql源安装包 shell > wget http : / / dev . mysql . com / get / mysql57 - community - release - el7 - 8. noarch . rpm 安装mysql源 shell > yum localinstall mysql57 - community - release - el7 - 8. noarch . rpm 检查mysql源是否安装成功 shell > yum repolist enabled | grep "mysql.*-community.*" 检查mysql源安装是否正确 看到上图所示表示安装成功。 可以修改vim /etc/yum.repos.d/mysql-community.repo源,改变默认安装的mysql版本。比如要安装5.6版本,将5.7源的enabled=1改成enabled=0。然后再将5.6源的enabled=0改成enabled=1即可。改完之后的效果如下所示: 这里写图片描述 2、安装MySQL shell > yum install mysql - community -

How to access data/data files of Android without a terminal on the Android device

旧街凉风 提交于 2020-01-15 08:21:25
问题 I have an Android 4.2.0 device that I have rooted with Kingo Root through a Windows machine. I also have a Unix machine available. I want to be able to transfer and read the contents of the data/data folders of my device to my computer. While I understand that I can use the adb shell (or a phone-installed terminal) as described here, I don't have internet connection on my Android device to download and install a terminal. Is there some way to transfer and read the contents of the data/data

bzoj1805: [Ioi2007]Sail 船帆

浪子不回头ぞ 提交于 2020-01-15 07:47:48
可以发现旗杆的顺序是没有用的,对于每列,它的答案是它的最大值mx*(mx+1)/2 高度由小到大排序旗杆,问题可以转化为在前h行选k个最小的值 考虑激情splay乱搞(我只会splay......) 设树中序遍历第i个点的d值表示当前最后一个旗帜上面的数字为i-1的列的数量 我们可以二分一下求出我们要利用到第几个点x,对于x之前的点,他们的d值都要全部送给后一个点 所以我们可以删掉x这个点,并在最前面加一个点,这就相当于整体向右移动了一位 对于x这个点单独处理,删除前计算出留在x的数目和给x+1的数目,处理完以后再单独添加 #include<cstdio> #include<iostream> #include<cstring> #include<cstdlib> #include<algorithm> #include<cmath> using namespace std; typedef long long LL; struct trnode { int f,son[2],c,d,s; }tr[410000];int trlen,root,cnt; void update(int x) { int lc=tr[x].son[0],rc=tr[x].son[1]; tr[x].c=tr[lc].c+tr[rc].c+1; tr[x].s=tr[lc].s+tr[rc].s+tr

mysql安装详细步骤图解

孤街浪徒 提交于 2020-01-15 06:55:03
mysql安装详细步骤图解 本文转自http://blog.csdn.net/fanyunlei/article/details/21454645 别看图多,其实mysql的安装十分简单,一路next即可,只是注意倒数第三步,设定root管理员密码的时候,一定要记住即可。 下面的是MySQL安装的图解,用的可执行文件安装的,详细说明了一下!打开下载的mysql安装文件mysql-5.0.27-win32.zip,双击解压缩,运行“setup.exe”,出现如下界面 mysql安装图文教程1 mysql安装向导启动,按“Next”继续 mysql图文安装教程2 选择安装类型,有“Typical(默认)”、“Complete(完全)”、“Custom(用户自定义)”三个选项,我们选择“Custom”,有更多的选项,也方便熟悉安装过程: mysql图文安装教程3 在“Developer Components(开发者部分)”上左键单击,选择“This feature, and all subfeatures, will be installed on local hard drive.”,即“此部分,及下属子部分内容,全部安装在本地硬盘上”。在上面的“MySQL Server(mysql服务器)”、“Client Programs(mysql客户端程序)”、“Documentation

default.conf

允我心安 提交于 2020-01-15 05:22:54
1、 /etc/nginx/conf.d/ 下设置一个 default.conf,server_name 设置为 localhost,如果有其他非法域名 A 记录到该机器上, 则返回默认的 Nginx 页面 server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } 2、 server { listen 80; root /var/www/html; index index.html index.htm index.php; server_name _; error_page 500 502 503 504 /50x

在Linux上用rpm 安装及配置MariaDB

半腔热情 提交于 2020-01-15 03:53:08
安装MariaDB 1.切换到root用户,首先执行 rpm -qa | grep -i mysql 检查一下是否有已安装的与MySQL相关的东西,如果有,使用 rpm -e --nodeps mysql* 进行强制卸载 2.使用yum安装MariaDB,执行 yum -y install mariadb mariadb-server 3.安装完成后,执行 systemctl start mariadb 启动MariaDB,执行 systemctl enable mariadb 设置开机启动 配置MariaDB 1.执行 mysql_secure_installation 进行相关配置 - 首先是设置密码,会提示先输入密码: * Enter current password for root (enter for none):<–初次运行直接回车 - 设置密码 * Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车 * New password: <– 设置root用户的密码 * Re-enter new password: <– 再输入一次你设置的密码 - 其它配置 * Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车 * Disallow root login remotely? [Y

Bash脚本编程之字符串处理

非 Y 不嫁゛ 提交于 2020-01-15 03:47:19
简介 其实这里说得字符串处理,对应的是bash官网中的 【Shell Parameter Expansion】 ,不过直接去看这部分内容实在是太难以理解了。字符串处理会比较好理解,平常使用应该也是足够的了。 字符串切片 这块在上一篇讲解数组的文章中 Bash脚本编程之数组 ,也大概提到了Shell Parameter Expansion除了可以对数组(array)切片以外,还可以对变量切片。 ${var:offset:number} ${var: length} [ root@c7-server ~ ] # name="zhangwenlong" [ root@c7-server ~ ] # echo ${name} zhangwenlong [ root@c7-server ~ ] # echo ${name:2:5} angwe [ root@c7-server ~ ] # echo ${name: -4} long 基于pattern取子串 这里的pattern,应该是glob或者类glob的,而非正则表达式,详见官方的 Pattern Matching 。 ${var#*pattern}:在变量var的值中自左向右查询pattern,若查询到,则删除值首部至第一次出现的pattern之间的所有字符。 [ root@c7-server ~ ] # echo ${name}

十五、二叉树剪枝

别等时光非礼了梦想. 提交于 2020-01-15 01:58:26
1、题目 链接 给定二叉树根结点 root ,此外树的每个结点的值要么是 0,要么是 1。 返回移除了所有不包含 1 的子树的原二叉树。 ( 节点 X 的子树为 X 本身,以及所有 X 的后代。) 示例: 输入: [1,0,1,0,0,0,1] 输出: [1,null,1,null,1] 2、分析 此题是对二叉树进行减枝操作,只需要进行递归操作即可. 3、代码 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution : def pruneTree ( self , root : TreeNode ) - > TreeNode : if not root : return root . left = self . pruneTree ( root . left ) root . right = self . pruneTree ( root . right ) if root . val == 0 and not root . left and not root . right : return None return root 4、结果

MySql主从双向复制配置

眉间皱痕 提交于 2020-01-14 20:03:34
1.分别修改主从节点的mysql数据库配置 vim /etc/my.cnf #主(备) server-id = 1 #(backup这台设置为2) log-bin=mysql-bin binlog-ignore-db = mysql,information_schema #忽略写入binglog日志的库 log-slave-updates = 1 #从库的写操作记录到bin-log expire_logs_days = 10 #日志过期天数 auto-increment-increment = 2 #字段变化增量值 auto-increment-offset = 1 # 初始字段ID为1, (备用库为2) slave-skip-errors = all 分别重启mysql service mysqld restart 2.为主从数据库分配权限 连接主数据库,为从数据库分配权限 mysql -u root -p GRANT REPLICATION SLAVE ON *.* TO 'root'@'从数据库IP' IDENTIFIED BY '从数据库密码'; flush privileges; 连接从数据库,为主数据库分配权限 mysql -u root -p GRANT REPLICATION SLAVE ON *.* TO 'root'@'主数据库IP' IDENTIFIED BY

saltstack安装

橙三吉。 提交于 2020-01-14 18:22:53
服务端安装 1)到阿里云镜像地址http://mirrors.aliyun.com/repo/ 下载对应版本的扩展源配置 文件epel.repo 上传到本机的/etc/yum.repos.d目录 2)yum install salt-master systemctl enable salt-master.service mkdir -p /srv/salt/{dev,prod} 编辑配置文件/etc/salt/master 【 file_roots: base: /srv/salt/ dev: /srv/salt/dev prod: /srv/salt/prod 】 systemctl start salt-master.service 客户端安装 1)同服务端安装一样,上传epel.repo 上传到本机的/etc/yum.repos.d目录 2)yum install salt-minion systemctl enable salt-minion.service 编辑配置文件/etc/salt/minion 【 master: 192.168.233.100 id: test01 】 systemctl start salt-minion.service 添加主机 在master节点上执行salt-key -L查看可添加的minion节点 执行salt-key -A