零碎知识点整理
一
root用户允许远程登录数据库
解决方法:
mysql> Grant all privileges on *.* to 'root'@'%' identified by 'Passw0rd' with grant option;
(%表示是所有的外部机器,如果指定某一台机,就将%改为相应的机器名;‘root’则是指要使用的用户名,)
mysql> flush privileges; (运行此句才生效,或者重启MySQL)
Query OK, 0 rows affected (0.03 sec)
https://blog.csdn.net/weixin_34072857/article/details/92495770
二
服务器访问人数可以通过命令: netstat -pnt | grep :80 列出,比如此时请求服务器上一个页面,通过该命令可以查看结果,后面的ESTABLISHED表示服务器正在被访问,可以通过添加 wc -l 统计数量,最终命令是: netstat -pnt | grep :80 | wc -l 此命令可以统计服务器所有url被请求的数量
netstat -pnt | grep :80 | wc -l
三
针对忘记root密码方式:
1、编辑/etc/my.cnf文件
vi /etc/my.cnf
2、在[mysqld]下面添加一条命令:skip-grant-tables
4.1 进入MySql控制台(直接按回车,这时不需要输入root密码。)
mysql -uroot -p
4.2 切换到mysql数据库
mysql>use mysql;
4.3 修改mysql数据库中root的密码
mysql> update user set password=password(“填入新密码”) where user=‘root’;
4.4 刷新mysql权限
mysql> flush privileges;
4.5 退出
mysql> exit;
5、再次vi /etc/my.cnf。把skip-grant-tables删除掉。保存退出。完成MySql Root密码修改
linux CentOS7下 mysql5.7.25 密码改简单的方法
在 vim /etc/my.cnf配置文件中增加:
validate_password=off
default_password_lifetime=0
重新启动
执行:update mysql.user set authentication_string=password('123456') where user='root' ;
php错误提示开启关闭有两种方式
1.在php.ini中找到 display_errors,设置错误提示的开启和关闭,off时关,on时开。同时设置error_reporting的值代表错误的级别
四,
查看当前目录文件总数
ls -l | grep "^-" | wc -l、
1,查看并发数
netstat -pnt | grep :80 | wc -l
2,查看一下22端口监听状态:netstat -tunlp | grep 22
查看一下防火墙状态: systemctl status firewalld
3,php think build --module test创建新模块
4,解包:tar zxvf FileName.tar
打包:tar czvf FileName.tar DirName
tar 打包解压到指定文件
tar -vxf suyuanmakc.tar -C /data/wwwroot/default/allfiles
5,查看当前目录文件总数
ls -l | grep "^-" | wc -l
6,使别人无法ping你的机器:
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
user group others
chmod u=rwx,g=rx,o=r test1 // 修改 test1 权限
[root@www tmp]# mkdir -p test1/test2/test3/test4
加了这个 -p 的选项,可以自行帮你创建多层目录!
[root@www ~]# cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m
默认的情况中,显示前面 10 行!若要显示前 20 行,就得要这样:
head -n 20 /etc/man.config
tail /etc/man.config
# 默认的情况中,显示最后的十行!若要显示最后的 20 行,就得要这样:
tail -n 20 /etc/man.config
?word 向光标之上寻找一个字符串名称为 word 的字符串。
把 textfile1 的文档内容加上行号后输入 textfile2 这个文档里:
cat -n textfile1 > textfile2
把 textfile1 和 textfile2 的文档内容加上行号(空白行不加)之后将内容附加到 textfile3 文档里:
cat -b textfile1 textfile2 >> textfile3
清空 /etc/test.txt 文档内容:
cat /dev/null > /etc/test.txt
7,php错误提示开启关闭有两种方式
在php.ini中找到 display_errors,设置错误提示的开启和关闭,off时关,on时开。同时设置error_reporting的值代表错误的级别
8, zip -r 压缩后的文件名 压缩前路径
uzip 文件名
9,服务器访问人数可以通过命令: netstat -pnt | grep :80 列出,比如此时请求服务器上一个页面,通过该命令可以查看结果,后面的ESTABLISHED表示服务器正在被访问,可以通过添加 wc -l 统计数量,最终命令是: netstat -pnt | grep :80 | wc -l 此命令可以统计服务器所有url被请求的数量
netstat -pnt | grep :80 | wc -l
10,查询数据表中某个字段(tel)出现相同内容大于1的情况
select id,name,tel from `member` where tel in (select tel from `member` group by tel having count(tel)>1);
11,root用户允许远程登录数据库
解决方法:
mysql> Grant all privileges on *.* to 'root'@'%' identified by 'Passw0rd' with grant option;
(%表示是所有的外部机器,如果指定某一台机,就将%改为相应的机器名;‘root’则是指要使用的用户名,)
mysql> flush privileges; (运行此句才生效,或者重启MySQL)
Query OK, 0 rows affected (0.03 sec)
https://blog.csdn.net/weixin_34072857/article/details/92495770
12,php 在linux 同时上传多个文件时报错 SplFileObject::__construct(/tmp/phpvfQPvQ):
原创skalpat 最后发布于2018-12-14 16:08:30 阅读数 831 收藏
展开
分析:这个不是上传文件的最大值的问题,而是由于linux系统自动清除临时文件的愿意造成的
thinkphp\library\think\File.php 的构造函数加个判断
if(file_exists($filename))
public function __construct($filename, $mode = 'r')
{
if(file_exists($filename)){
parent::__construct($filename, $mode);
$this->filename = $this->getRealPath();
}
}
13,ab -n 1000 -c 10 http://dev.yzygy.com/h5
14,怎么取消开机自动启动软件
这里需要利用电脑管家,以【360卫士】为例:打开360卫士,点击【优化加速】-【启动项】,点击软件右侧的【禁止启动】即可。
15,修改用户所属组
usermod -g yonghuzu yonghuming
16,linux查看指定文件夹大小
du -sh 目录/
重启php service php-fpm restart
重启Nginx
service nginx restart
17,针对忘记root密码方式:
1)、编辑/etc/my.cnf文件
vi /etc/my.cnf
2)、在[mysqld]下面添加一条命令:skip-grant-tables
4).1 进入MySql控制台(直接按回车,这时不需要输入root密码。)
mysql -uroot -p
4).2 切换到mysql数据库
mysql>use mysql;
4).3 修改mysql数据库中root的密码
mysql> update user set password=password(“填入新密码”) where user=‘root’;
4).4 刷新mysql权限
mysql> flush privileges;
4).5 退出
mysql> exit;
5、再次vi /etc/my.cnf。把skip-grant-tables删除掉。保存退出。完成MySql Root密码修改
linux CentOS7下 mysql5.7.25 密码改简单的方法
在 vim /etc/my.cnf配置文件中增加:
validate_password=off
default_password_lifetime=0
重新启动
执行:update mysql.user set authentication_string=password('123456') where user='root' ;
linux查看指定文件夹大小
du -sh 目录/
重启php service php-fpm restart
重启Nginx
service nginx restart