Mysql

启动测试:
# systemctl status mysqld.service
 
 
查看日志:
tail -n 200  /var/log/mysqld.log
 
2018-08-10T02:24:04.877063Z 0 [Warning] Can't create test file /data/mysql/VM_129_126_centos.lower-test
 
2018-08-10T02:24:04.906042Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
 
日志
 
设置权限:
[root@VM_129_126_centos mysql]# sudo chmod 777 /data/mysql/
再次测试:
 
 
 
 
重启:
mysqld restart --user=root
 
 
 
 
 
 =================================================================================
 
 
 
 
 
 
 
create database jnshu default charset utf8;
 
停止
service mysqld stop
启动服务
service mysqld start
重启
service mysqld restart
 
mysqld --initialize --user=root
mysqld --user=root
mysqld restart --user=root
 
mysqld --skip-grant-tables
 
重启服务器
 
"jdbc:mysql://119.29.17.188/jnshu?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true";
 
日志:
vim /var/log/mysqld.log
tail -n 100 /var/log/mysqld.log  

Packet for query is too large (12238 > 1024). You can change this value

 
show VARIABLES like '%max_allowed_packet%';
 
set global max_allowed_packet = 2*1024*1024*10
 
 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
 
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
 
 
删除 /var/lib/mysql/mysql.sock
重新mysql -uroot -p
 
提示:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
 
停止
service mysqld stop
 
启动服务
service mysqld start
 
提示:
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details
 
使用:
mysqld --user=root
 
重新连接
 
 
 
 
 
查看:
systemctl status mysqld.service
 
 
 
journalctl -xe
 
 
 
 
Can't create test file /data/mysql/VM_129_126_centos.lower-test
 
 
 
 
vi /etc/selinux/config
 

摘抄:

下面为转:

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-11/137723.htm

1. 查看SELinux状态

1.1 getenforce

  • getenforce 命令是单词get(获取)和enforce(执行)连写,可查看selinux状态,与setenforce命令相反。
  • setenforce 命令则是单词set(设置)和enforce(执行)连写,用于设置selinux防火墙状态,如: setenforce 0用于关闭selinux防火墙,但重启后失效
    [root@localhost ~]# getenforce
    Enforcing

1.2 /usr/sbin/sestatus

Current mode表示当前selinux防火墙的安全策略
[root@localhost ~]# /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
SELinux status:selinux防火墙的状态,enabled表示启用selinux防火墙
Current mode: selinux防火墙当前的安全策略,enforcing 表示强

2. 关闭SELinux

2.1 临时关闭

setenforce 0 :用于关闭selinux防火墙,但重启后失效。
[root@localhost ~]# setenforce 0
[root@localhost ~]# /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28

2.1 永久关闭

修改selinux的配置文件,重启后生效。

打开 selinux 配置文件

[root@localhost ~]# vim /etc/selinux/config

修改 selinux 配置文件

将SELINUX=enforcing改为SELINUX=disabled,保存后退出
# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy is loaded.SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:# targeted - Targeted processes are protected,# minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection.SELINUXTYPE=targeted
此时获取当前selinux防火墙的安全策略仍为Enforcing,配置文件并未生效。
[root@localhost ~]# getenforce
Enforcing

重启

[root@localhost ~]# reboot

验证

[root@localhost ~]# /usr/sbin/sestatus
SELinux status: disabled
 
[root@localhost ~]# getenforce
Disabled
 

mysql(linux下)bug集结的更多相关文章

  1. [mysql] linux下使用yum安装mysql

    From: http://www.2cto.com/database/201207/141878.html linux下使用yum安装mysql   1.安装 查看有没有安装过:           ...

  2. [Linux & Mysql] Linux下Mysql的基本操作

    1. 连接Mysql 1.1 连接到本机上的Mysql 键入命令mysql -u root -p,回车后提示你输密码.注意用户名前可以有空格也可以没有空格,但是密码前必须没有空格,否则让你重新输入密码 ...

  3. [mysql] linux 下mysql 5.7.12 安装

    1.下载mysql wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar ...

  4. MySQL - Linux下安装

    本安装方式仅对5.7.21版本负责. 下载地址:wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2 ...

  5. mysql linux下安装部署

    一.安装简介 用户名:mysql安装目录:/usr/local/mysql-5.5数据库目录:/data/mysql/data源码包:mysql-5.5.28.tar.gz 二.安装准备 a.vi / ...

  6. mysql linux下表名忽略大小写注意事项

    在Unix中使用lower_case_tables_name=0,在Windows中使用lower_case_tables_name=2.这样了可以保留数据库名和表名的大小写.不利之处是必须确保在Wi ...

  7. Linux下mysql安装过程

    到mysql官网下载mysql编译好的二进制安装包,在下载页面Select Platform:选项选择linux-generic,然后把页面拉到底部,64位系统下载Linux - Generic (g ...

  8. 一看便知linux下mysql报错ERROR 1044: Access denied for user: '@localhost' to database 'mysql'

    错误信息:ERROR 1044: Access denied for user: '@localhost' to database 'mysql' linux下解决方案: mysql> use ...

  9. linux 下配置mysql区分大小写(不区分可能出现找不到表的情况)怎么样使用yum来安装mysql

    Linux 默认情况下,数据库是区分大小写的:因此,要将mysql设置成不区分大小写 在my.cof 设置 lower_case_table_names=1(1忽略大小写,0区分大小写) 检查方式:在 ...

  10. 转载Linux下开启MySQL日志

    转载https://blog.csdn.net/weixin_38187469/article/details/79273962 开启mysql日志   1.查看日志是否启用 mysql> sh ...

随机推荐

  1. 第三周博客之二---Oracle中的sql语句

    一.用户及权限(DBA有最高系统权限) 1.数据库的安全性:系统的安全性.数据的安全性 2.权限分类: 2.1系统权限:获得后可访问数据库 常用的有create table,create user,c ...

  2. Exception、Thorow、Throws、TryCatch

    一.异常 概述: 异常指的是不正常,指的是程序中出现了某种问题 java中,所有问题都可以使用一个类来表示,这个类叫做Throwable Throwable: Throwawble是java中所有异常 ...

  3. JAVA 第1课

    JAVA第一课 电脑识别的进制:二进制,八进制,十六进制 二进制来表示高低电压,类似于抗战时期的发报机.2进制的存储 8进制和16进制:计算器,在计算的时候有一定的临时存储,8位或者16位禁止的存储 ...

  4. JVM CUP占用率过高排除方法,windows环境

    jdk自带的jvisualvm可以看到程序CPU使用率,但是无法确定具体的线程,想要确定到具体的线程需要借用到微软的Process Explorer 具体排除方法: 一:打开资源管理器,找到cup占用 ...

  5. 获取百度地图POI数据一(详解百度返回的POI数据)

    POI是一切可以抽象为空间点的现实世界的实体,比如餐馆,酒店,车站,停车场等.POI数据具有空间坐标和各种属性,是各种地图查询软件的基础数据之一.百度地图作为国内顶尖的地图企业,其上具有丰富的POI数 ...

  6. shell练习题7

    需求如下: 输入一串随机数字,然后按千分位输出. 例如:输入随机数字为"123456789",输出为123,456,789 参考解答如下 -方法1 [root@lanquark s ...

  7. shell中的输出重定向

    shell中默认有三个标准设备:标准输入(STDIN).标准输出(STDOUT).标准错误(STDERR). 在Linux系统中,一切(或几乎一切)都是文件.因此,标准输入的文件描述符是0,标准输出的 ...

  8. [.NET] 使用ValidationContext快速进行模型资料的验证

    在进行WebAPI功能开发的时候,一般传统的验证资料是否合法的方式,都是透过if/else的方式进行判断若是使用ValidationContext,就可以省去很多自行撰写程式码的工作 要使用Valid ...

  9. Shiro-ini认证

    #2019.2.2 shiro的ini认证 先用IDEA创建一个普通的MAVEN项目,并导入依赖 <!--Junit单元测试--> <groupId>junit</gro ...

  10. ionic3 对android包进行签名

    在已经生成签名文件的前提下 对android包进行签名 如果还未生成签名文件 请参考链接 https://jingyan.baidu.com/article/642c9d34eaeeda644a46f ...