• 二进制安装mysql


    如果没有设置密码,配置文件设置grant-skip-tables,只需要生效即可
    MariaDB [(none)]> grant all on *.* to 'test'@'192.168.30.%'identified by '123.com';
    ERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
    MariaDB [(none)]> flush privileges;
    Query OK, 0 rows affected (0.00 sec)


    utf8修改字符集
    [mysqld]
    datadir=/usr/local/mysql/data
    socket=/tmp/mysql.sock

    character-set-server=utf8
    [client]
    default-character-set=utf8

    [mysqld_safe]
    log-error=/usr/local/mysql/data/mysql.log
    pid-file=/usr/local/mysql/data/mysql.pid

    mysql >show variables like 'character_set_%';

    ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
    报错
    解决办法
    1、 修改用户密码
    mysql> alter user 'root'@'localhost' identified by 'youpassword';
    2、刷新权限
    mysql> flush privileges;

    systemctl stop firewalld
    systemctl disable firewalld
    setenforce 0
    iptables -F
    yum -y install libaio
    tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz -C /usr/local
    cd /usr/local
    ln -s mysql-5.7.24-linux-glibc2.12-x86_64/ mysql
    useradd -M -s /sbin/nologin mysql
    chown -R mysql:mysql ./
    cd mysql
    [root@bogon mysql]# ./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize
    把密码记下来
    6#tlVZ9HW(tQ
    [root@bogon mysql]# vim /etc/my.cnf
    [mysqld]
    datadir=/usr/local/mysql/data
    socket=/tmp/mysql.sock

    [mysqld_safe]
    log-error=/usr/local/mysql/data/mysql.log
    pid-file=/usr/local/mysql/data/mysql.pid

    [root@bogon mysql]# ./support-files/mysql.server start
    [root@bogon mysql]# netstat -anpt |grep :3306
    tcp6       0      0 :::3306                 :::*                    LISTEN      3469/mysqld  
    cp support-files/mysql.server /etc/init.d/mysqld
    ls -l /etc/init.d/mysqld

    ln -s /usr/local/mysql/bin/* /usr/local/bin
    service mysqld stop
    vim /etc/my.cnf
    添加skip-grant-tables
    启动服务service mysqld start
    mysql -uroot -p
    回车
    mysql> use mysql;
    mysql> update mysql.user set authentication_string=password("123456789") where user='root';
    mysql> flush privileges;
    mysql> exit

    关闭服务,service mysqld stop
    把skip-grant-tables加#注释或删除
     service mysqld start启动服务

    mysql -uroot -p进去密码已修改为123456789
    如果数据库无法查看库和表说明你的语句有问题
    ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
    报错
    解决办法
    1、 修改用户密码
    mysql> alter user 'root'@'localhost' identified by 'youpassword';
    2、刷新权限
    mysql> flush privileges;

  • 相关阅读:
    ARMV8 datasheet学习笔记3:AArch64应用级体系结构之Memory order
    ARMV8 datasheet学习笔记3:AArch64应用级体系结构之Atomicity
    ARMV8 datasheet学习笔记3:AArch64应用级体系结构
    ARMV8 datasheet学习笔记2:概述
    最短路径
    网络流
    二分图
    zabbix 3.4新功能值预处理
    zabbix 3.4新功能值解析——Preprocessing预处理
    Zabbix监控windows的CPU利用率和其他资源
  • 原文地址:https://www.cnblogs.com/zc1741845455/p/10921284.html
Copyright © 2020-2023  润新知