zoukankan      html  css  js  c++  java
  • 二进制安装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;

  • 相关阅读:
    2013百度轻应用巡讲沙龙上海站
    xcode自动打ipa包脚本 资料
    Xcode 自动对齐 插件
    Lable中添加链接文字。。。各种操作 都能满足。简单易用【NIAttributedLabel】
    XMPP 安装ejabberd 搭建服务器环境
    git 终端命令行工具(忽略大小写,很好用)
    IOS团队开发之——CocoaPods 第三方库管理工具
    XCode 调试方法 (很全 很有用)
    模块化设计-iOS团队协作开发 v1.0
    淘宝技术部(ios 优化方案)
  • 原文地址:https://www.cnblogs.com/zc1741845455/p/10921284.html
Copyright © 2011-2022 走看看