您的位置:新葡亰496net > 网络数据库 > 新葡亰496net:11装置配置,新版mysql搭建八线程主

新葡亰496net:11装置配置,新版mysql搭建八线程主

发布时间:2019-12-10 14:08编辑:网络数据库浏览(116)

    官方网址地址:https://dev.mysql.com/downloads/mysql/

    官方网站地址:

    新版mysql搭建八线程主从复制

    风度翩翩:首先拿到
    mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar

    tar xf mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar
    yum install -y mysql-community-client-5.7.11-1.el6.x86_64.rpm mysql-community-common-5.7.11-1.el6.x86_64.rpm mysql-community-libs-5.7.11- 1.el6.x86_64.rpm mysql-community-libs-compat-5.7.11-1.el6.x86_64.rpm mysql-community-server-5.7.11-1.el6.x86_64.rpm

    启动:
    /etc/init.d/mysqld start
    [[email protected] mnt]# /etc/init.d/mysqld start
    Initializing MySQL database: [ OK ]
    Installing validate password plugin: [ OK ]
    Starting mysqld: [ OK ]

    赢得起首密码:
    grep 'temporary password' /var/log/mysqld.log
    mysql -p 回车之后输入开始密码

    改密码:
    ALTER USER [email protected] identified by 'Redhat007!'
    密码准则:必需高于陆人 ,有大写,小写,数字,特殊字符

    下一场在内部创制数量库 xp1 后边测量试验要用
    mysql> create database xp1;
    下一场本身在 /mnt底下创制了add.sql (方便前面使用)代码如下:

    CREATE TABLE usertb (
     id serial,
    uname varchar(20),
    ucreatetime datetime ,
    age int(11)
    )
    ENGINE=MYISAM
    DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
    AUTO_INCREMENT=1
    ROW_FORMAT=COMPACT;
    
    delimiter $$
    SET AUTOCOMMIT = 0$$
    
    create procedure test1()
    begin
    declare v_cnt decimal (10) default 0 ;
    dd:loop
    insert into usertb values
    (null,'用户1','2010-01-01 00:00:00',20),
    (null,'用户2','2010-01-01 00:00:00',20),
    (null,'用户3','2010-01-01 00:00:00',20),
    (null,'用户4','2010-01-01 00:00:00',20),
    (null,'用户5','2011-01-01 00:00:00',20),
    (null,'用户6','2011-01-01 00:00:00',20),
    (null,'用户7','2011-01-01 00:00:00',20),
    (null,'用户8','2012-01-01 00:00:00',20),
    (null,'用户9','2012-01-01 00:00:00',20),
    (null,'用户0','2012-01-01 00:00:00',20)
    ;
    commit;
    set v_cnt = v_cnt 10 ;
    if v_cnt = 10000000 then leave dd;
    end if;
    end loop dd ;
    end;$$
    
    delimiter ; 
    

    接下来在新创立的特别数据库中实行这段代码
    新葡亰496net 1
    触发代码中的存款和储蓄进度
    call test1 会在usertb 表中插入黄金时代千万行数据
    如下申明数据已经插入
    新葡亰496net 2
    校订代码,在向里面成立表usertb1 ,然后继续接触,往里面写入少年老成千万行数据
    (创造三个表首要想让mysqldump和mysqlpump的差异更猛烈卡塔尔(قطر‎
    如投注解创变成功
    新葡亰496net 3

    测试mysqldump 和mysqlpump
    mysqldump:
    新葡亰496net 4
    mysqlpump:
    time mysqlpump -p xp1 > xp1.sql
    新葡亰496net 5
    如上,鲜明快了十秒,那还使用的是mysqlpump的默许线程数 2
    time mysqlpump -pRedhat006! --default-parallelism=4 db1 > db1.sql
    --default-parallelism=4 使用线程数 能够协和校正

    做个mysql的A -- B复制
    安顿情形: master: 172.25.254.10
    slave: 172.25.254.11
    首先在master主机里
    vim /etc/my.cnf
    server-id=1
    log-bin=mysql-bin
    binlog-do-db=test
    /etc/init.d/mysqld restart
    mysql -pRedhat007!
    用如下命令查看一下,看是或不是中标
    新葡亰496net 6
    新葡亰496net:11装置配置,新版mysql搭建八线程主从复制。新建test库: create database test;

    授权:
    mysql> grant replication slave on *.* to [email protected]'172.25.254.11' identified by 'Redhat007!';
    Query OK, 0 rows affected, 1 warning (0.40 sec)
    /etc/init.d/mysqld restart

    slave端: 172.25.254.11
    vim /etc/my.cnf
    server-id=2 与master分歧就可以
    接下来再slave上边安装新型版的mysql
    首先验证master是或不是授权成功
    mysql -pRedhat007! -uxpp -h172.25.254.10 假若得以登入进去的话就申明成功

    mysql -pRedhat007!
    新建test库,因为在做联合以前多个数据库中的内容必须大器晚成律
    然后:chang master to master_host='172.25.254.10', master_user='xpp' , master_password='Redhat007!', master_log_file='mysql-bin.000001', master_log_pos=154;

    /etc/init.d/mysqld restart

    在master端:
    MySQL 的新特征之风度翩翩,是投入了大局工作 ID (GTID)来深化数据库的主备黄金年代致性,故障苏醒,以至容错技巧
    vim /etc/my.cnf 加如下两行,开启gtid方式

    gtid-mode=on
    enforce-gtid-consistency=on

    /etc/init.d/mysqld restart

    然后再slave上
    vim /etc/my.cnf 加如下
    gtid-mode=on
    enforce-gtid-consistency=on
    slave-parallel-type=LOGICAL_CLOCK
    slave-parallel-workers=16
    master_info_repository=TABLE
    relay_log_info_repository=TABLE
    relay_log_recovery=ON

    /etc/init.d/mysqld restart

    生机勃勃:首先得到mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar tar xf mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar yum install -y mysql-community-cl...

    本身那边是逍客HEL6.5的种类,由此筛选RedHat 6 x86,64bit操作系统---下载第三个RPM Bundle就能够--mysql-8.0.11-1.el6.x86_64.rpm-bundle.tar。

    本身这里是昂CoraHEL6.5的种类,因而选用RedHat 6 x86,64bit操作系统---下载第三个RPM Bundle就能够--mysql-8.0.11-1.el6.x86_64.rpm-bundle.tar。

    眼下MySQL8.0.11社区版提供了美妙绝伦的设置形式,你也能够因此下载Linux Generic安装包mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz来设置,这种设置方式没有必要考虑包宽容性,本文只描述rpm安装方式。

    近日MySQL8.0.11社区版提供了成千成万的装置形式,不过从未开采针对Linux Generic安装托特包含的mysql_secure_installation的装置表达。

    一、mysql-8.0.11-1.el6.x86_64.rpm-bundle.tar解压后有如下7个文本:

    据此这里运用推荐的RPM安装:

    -rw-r--r-- 1 root root  28987588 Apr  9 01:06 mysql-community-client-8.0.11-1.el6.x86_64.rpm
    -rw-r--r-- 1 root root    672184 Apr  9 01:06 mysql-community-common-8.0.11-1.el6.x86_64.rpm
    -rw-r--r-- 1 root root   4443296 Apr  9 01:06 mysql-community-devel-8.0.11-1.el6.x86_64.rpm
    -rw-r--r-- 1 root root   2579460 Apr  9 01:06 mysql-community-libs-8.0.11-1.el6.x86_64.rpm
    -rw-r--r-- 1 root root   1902676 Apr  9 01:06 mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm
    -rw-r--r-- 1 root root 395918848 Apr  9 01:07 mysql-community-server-8.0.11-1.el6.x86_64.rpm
    -rw-r--r-- 1 root root  49092596 Apr  9 01:07 mysql-community-test-8.0.11-1.el6.x86_64.rpm
    

    一、mysql-8.0.11-1.el6.x86_64.rpm-bundle.tar解压后有如下7个文本:

    下一场创制mysql顾客:

    -rw-r--r-- 1 root root 28987588 Apr 9 01:06 mysql-community-client-8.0.11-1.el6.x86_64.rpm-rw-r--r-- 1 root root 672184 Apr 9 01:06 mysql-community-common-8.0.11-1.el6.x86_64.rpm-rw-r--r-- 1 root root 4443296 Apr 9 01:06 mysql-community-devel-8.0.11-1.el6.x86_64.rpm-rw-r--r-- 1 root root 2579460 Apr 9 01:06 mysql-community-libs-8.0.11-1.el6.x86_64.rpm-rw-r--r-- 1 root root 1902676 Apr 9 01:06 mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm-rw-r--r-- 1 root root 395918848 Apr 9 01:07 mysql-community-server-8.0.11-1.el6.x86_64.rpm-rw-r--r-- 1 root root 49092596 Apr 9 01:07 mysql-community-test-8.0.11-1.el6.x86_64.rpm
    
    useradd mysql
    passwd mysql
    

    然后创立mysql客商:

    二、安装顺序为:(提出装以前先把前边的mysql相关包全体卸载,rpm -e --nodeps <包名>就能够)

    useradd mysqlpasswd mysql
    
    [root@python ~]# rpm -ivh mysql-community-common-8.0.11-1.el6.x86_64.rpm
    warning: mysql-community-common-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:mysql-community-common ########################################### [100%]
    [root@python ~]# rpm -ivh mysql-community-libs-8.0.11-1.el6.x86_64.rpm
    warning: mysql-community-libs-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:mysql-community-libs   ########################################### [100%]
    [root@python ~]# rpm -ivh mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm 
    warning: mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
     file /usr/lib64/mysql/libmysqlclient.so.16.0.0 from install of mysql-community-libs-compat-8.0.11-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-8.0.1.el6_8.x86_64
     file /usr/lib64/mysql/libmysqlclient_r.so.16.0.0 from install of mysql-community-libs-compat-8.0.11-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-8.0.1.el6_8.x86_64
    [root@python ~]# rpm -e --nodeps mysql-libs-5.1.73-8.0.1.el6_8.x86_64
    [root@python ~]# rpm -ivh mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm
    warning: mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:mysql-community-libs-co########################################### [100%]
    [root@python ~]# rpm -ivh mysql-community-server-8.0.11-1.el6.x86_64.rpm
    warning: mysql-community-server-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    error: Failed dependencies:
     mysql-community-client(x86-64) >= 8.0.0 is needed by mysql-community-server-8.0.11-1.el6.x86_64
    [root@python ~]# rpm -ivh mysql-community-client-8.0.11-1.el6.x86_64.rpm 
    warning: mysql-community-client-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:mysql-community-client ########################################### [100%]
    [root@python ~]# rpm -ivh mysql-community-server-8.0.11-1.el6.x86_64.rpm 
    warning: mysql-community-server-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:mysql-community-server ########################################### [100%]
    [root@python ~]# rpm -ivh mysql-community-devel-8.0.11-1.el6.x86_64.rpm 
    warning: mysql-community-devel-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:mysql-community-devel  ########################################### [100%]
    ^[[A[root@python ~]# rpm -ivh mysql-community-test-8.0.11-1.el6.x86_64.rpm 
    warning: mysql-community-test-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    error: Failed dependencies:
     perl(JSON) is needed by mysql-community-test-8.0.11-1.el6.x86_64
    --懒的去装perl了,因此测试套件就不装了。
    

    二、安装顺序为:(建议装以前先把此前的mysql相关包全体卸载,rpm -e --nodeps 就能够)

    三、安装完结后相关消息如下:

    [root@python ~]# rpm -ivh mysql-community-common-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-common-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ########################################### [100%] 1:mysql-community-common ########################################### [100%][root@python ~]# rpm -ivh mysql-community-libs-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-libs-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ########################################### [100%] 1:mysql-community-libs ########################################### [100%][root@python ~]# rpm -ivh mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ########################################### [100%] file /usr/lib64/mysql/libmysqlclient.so.16.0.0 from install of mysql-community-libs-compat-8.0.11-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-8.0.1.el6_8.x86_64 file /usr/lib64/mysql/libmysqlclient_r.so.16.0.0 from install of mysql-community-libs-compat-8.0.11-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-8.0.1.el6_8.x86_64[root@python ~]# rpm -e --nodeps mysql-libs-5.1.73-8.0.1.el6_8.x86_64[root@python ~]# rpm -ivh mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ########################################### [100%] 1:mysql-community-libs-co########################################### [100%][root@python ~]# rpm -ivh mysql-community-server-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-server-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYerror: Failed dependencies: mysql-community-client >= 8.0.0 is needed by mysql-community-server-8.0.11-1.el6.x86_64[root@python ~]# rpm -ivh mysql-community-client-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-client-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ########################################### [100%] 1:mysql-community-client ########################################### [100%][root@python ~]# rpm -ivh mysql-community-server-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-server-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ########################################### [100%] 1:mysql-community-server ########################################### [100%][root@python ~]# rpm -ivh mysql-community-devel-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-devel-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYPreparing... ########################################### [100%] 1:mysql-community-devel ########################################### [100%]^[[A[root@python ~]# rpm -ivh mysql-community-test-8.0.11-1.el6.x86_64.rpmwarning: mysql-community-test-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYerror: Failed dependencies: perl is needed by mysql-community-test-8.0.11-1.el6.x86_64--懒的去装perl了,因此测试套件就不装了。
    
    [root@python ~]# mysql -V
    mysql  Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)
    [root@python ~]# ll /etc/init.d/mysqld 
    -rwxr-xr-x 1 root root 7166 Apr  8 16:21 /etc/init.d/mysqld
    [root@python ~]# ll /etc/my.cnf --配置文件位置
    -rw-r--r-- 1 root root 1188 Apr  8 16:21 /etc/my.cnf
    

    三、安装收尾后相关音讯如下:

    私下认可的datadir是在/var/lib/mysql/,能够经过改善my.cnf改过,运转命令如下:

    [root@python ~]# mysql -Vmysql Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)[root@python ~]# ll /etc/init.d/mysqld-rwxr-xr-x 1 root root 7166 Apr 8 16:21 /etc/init.d/mysqld[root@python ~]# ll /etc/my.cnf --配置文件位置-rw-r--r-- 1 root root 1188 Apr 8 16:21 /etc/my.cnf
    
    [root@python ~]# service mysqld start
    Initializing MySQL database:                               [  OK  ]
    Starting mysqld:                                           [  OK  ]
    

    默许的datadir是在/var/lib/mysql/,可以透过修正my.cnf修改,运维命令如下:

    四、发掘没密码不能够登陆,于是增多skip-grant-tables到my.cnf,重启进去重新载入参数密码:

    [root@python ~]# service mysqld startInitializing MySQL database: [ OK ]Starting mysqld: [ OK ]
    

    Ps:20180517新扩展长:在装置完后,/var/log/mysqld.log里应该包含不时的root密码,能够一向登入,不过依然提议按本文方法修改掉密码验证的核心。 而在Windows平台使用msi安装时,则有自己作主筛选密码验证情势的步调,能够比较实惠的张开安装。

    四、开采没密码不能够登入,于是增添skip-grant-tables到my.cnf,重启进去重新载入参数密码

    mysql> alter user root@'localhost' identified by 'mysql';
    ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
    mysql> exit
    Bye
    
    mysql> alter user root@'localhost' identified by 'mysql';ERROR 1290 : The MySQL server is running with the --skip-grant-tables option so it cannot execute this statementmysql> exitBye
    

    以至不可能改。。。于是:

    居然不能够改。。。于是:

    mysql> delete from mysql.user where user='root';
    Query OK, 1 row affected (0.10 sec)
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> create user root@'localhost' identified by 'mysql';
    ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
    
    mysql> delete from mysql.user where user='root';Query OK, 1 row affected mysql> flush privileges;Query OK, 0 rows affected mysql> create user root@'localhost' identified by 'mysql';ERROR 1819 : Your password does not satisfy the current policy requirements
    

    要么不可能改,查看密码复杂度须要:

    照旧不可能改,查看密码复杂度需求:

    mysql> show variables like '%pass%';
     ---------------------------------------------- ----------------- 
    | Variable_name                                | Value           |
     ---------------------------------------------- ----------------- 
    | caching_sha2_password_auto_generate_rsa_keys | ON              |
    | caching_sha2_password_private_key_path       | private_key.pem |
    | caching_sha2_password_public_key_path        | public_key.pem  |
    | default_password_lifetime                    | 0               |
    | disconnect_on_expired_password               | ON              |
    | mysql_native_password_proxy_users            | OFF             |
    | password_history                             | 0               |
    | password_reuse_interval                      | 0               |
    | report_password                              |                 |
    | sha256_password_auto_generate_rsa_keys       | ON              |
    | sha256_password_private_key_path             | private_key.pem |
    | sha256_password_proxy_users                  | OFF             |
    | sha256_password_public_key_path              | public_key.pem  |
    | validate_password.check_user_name            | ON              |
    | validate_password.dictionary_file            |                 |
    | validate_password.length                     | 8               |
    | validate_password.mixed_case_count           | 1               |
    | validate_password.number_count               | 1               |
    | validate_password.policy                     | MEDIUM          |
    | validate_password.special_char_count         | 1               |
     ---------------------------------------------- ----------------- 
    
    mysql> show variables like '%pass%'; ---------------------------------------------- ----------------- | Variable_name | Value | ---------------------------------------------- ----------------- | caching_sha2_password_auto_generate_rsa_keys | ON || caching_sha2_password_private_key_path | private_key.pem || caching_sha2_password_public_key_path | public_key.pem || default_password_lifetime | 0 || disconnect_on_expired_password | ON || mysql_native_password_proxy_users | OFF || password_history | 0 || password_reuse_interval | 0 || report_password | || sha256_password_auto_generate_rsa_keys | ON || sha256_password_private_key_path | private_key.pem || sha256_password_proxy_users | OFF || sha256_password_public_key_path | public_key.pem || validate_password.check_user_name | ON || validate_password.dictionary_file | || validate_password.length | 8 || validate_password.mixed_case_count | 1 || validate_password.number_count | 1 || validate_password.policy | MEDIUM || validate_password.special_char_count | 1 | ---------------------------------------------- ----------------- 
    

    查阅官方网址

    翻开官方网址

    察觉此值有3个,如下所示:

    意识此值有3个,如下所示:

    新葡亰496net 7

    于是设置为0,然后将validate_password.length设置为4,表示起码供给4字符。之所以设置为4是因为这一个参数的值不能够小于如下公式的测算结果:

    于是乎设置为0,然后将validate_password.length设置为4,表示最少需求4字符。之所以设置为4是因为这些参数的值不可能小于如下公式的酌量结果:

    validate_password.number_count  validate_password.special_char_count  (2 * validate_password.mixed_case_count)
    
    validate_password.number_count
      validate_password.special_char_count
      (2 * validate_password.mixed_case_count)
    

    于是继续成立客户,MySQL8.0撤回了一向grant创设顾客的语法,只可以先create user再grant,因而创制root如下:

    新葡亰496net,于是继续开创顾客,MySQL8.0撤回了直白grant创制顾客的语法,只好先create user再grant,因而成立root如下:

    mysql> create user root@'localhost' identified by 'mysql';ERROR 1396 : Operation CREATE USER failed for 'root'@'localhost'mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected mysql> create user root@'localhost' identified by 'mysql';ERROR 1396 : Operation CREATE USER failed for 'root'@'localhost'
    
    mysql> create user root@'localhost' identified by 'mysql';
    ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'
    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)
    mysql> create user root@'localhost' identified by 'mysql';
    ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'
    

    尼玛...怎么玩意儿?

    尼玛...什么玩意儿?

    于是去逛了生机勃勃圈stackoverflow,都在说那是二个BUG,于是操作如下:

    于是去逛了生机勃勃圈stackoverflow,都在说那是三个BUG,于是操作如下:

    mysql> drop user root@'localhost'; --是的没错,虽然没有root@'localhost'用户,但你还是要删一遍。Query OK, 0 rows affected mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected mysql> create user root@'localhost' identified by 'mysql';Query OK, 0 rows affected mysql> grant all on *.* to root@'localhost' with grant option;Query OK, 0 rows affected 
    
    mysql> drop user root@'localhost';   --是的没错,虽然没有root@'localhost'用户,但你还是要删一遍。
    Query OK, 0 rows affected (0.05 sec)
    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.01 sec)
    mysql> create user root@'localhost' identified by 'mysql';
    Query OK, 0 rows affected (0.03 sec)
    mysql> grant all on *.* to root@'localhost' with grant option;
    Query OK, 0 rows affected (0.03 sec)
    

    终于改完密码了...去掉参数文件的skip-grant-tables参数,service mysqld restart重启服务。

    好不轻易改完密码了...去掉参数文件的skip-grant-tables参数,service mysqld restart重启服务。

    五、终于设置好密码了,建贰个测量检验顾客leo,然后尝试远程连接下呢:

    五、终于设置好密码了,建二个测量试验顾客leo,然后尝试远程连接下啊:

    $ mysql -uleo -pmysql -h192.168.1.193mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 2059 : Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
    
    $ mysql -uleo -pmysql -h192.168.1.193
    mysql: [Warning] Using a password on the command line interface can be insecure.
    ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
    

    本人那5.7的mysql工具都连不上,那就窘迫了,查看认证相关参数:

    自家那5.7的mysql工具都连不上,那就狼狈了,查看认证相关参数:

    mysql> show variables like '%auth%'; ------------------------------- ----------------------- | Variable_name | Value | ------------------------------- ----------------------- | default_authentication_plugin | caching_sha2_password | ------------------------------- ----------------------- 1 row in set 
    
    mysql> show variables like '%auth%';
     ------------------------------- ----------------------- 
    | Variable_name                 | Value                 |
     ------------------------------- ----------------------- 
    | default_authentication_plugin | caching_sha2_password |
     ------------------------------- ----------------------- 
    1 row in set (0.02 sec)
    

    翻开官方网址发掘此值的取值如下:

    查阅官方网站开采此值的取值如下:

    官方网址还说此值影响create user不显式钦赐auth plugin时密码的暗中认可加密算法,卧槽...那岂不是说小编事前创制的leo客户使用的是默许的caching_sha2_password认证,查看一下:

    新葡亰496net 8

    mysql> select user,host,plugin from mysql.user; ------------------ ----------- ----------------------- | user | host | plugin | ------------------ ----------- ----------------------- | leo | % | caching_sha2_password || mysql.infoschema | localhost | mysql_native_password || mysql.session | localhost | mysql_native_password || mysql.sys | localhost | mysql_native_password || root | localhost | caching_sha2_password | ------------------ ----------- ----------------------- 
    

    官方网址还说此值影响create user不显式内定auth plugin时密码的默许加密算法,卧槽...那岂不是说作者事情未发生前成立的leo客商选用的是暗中认可的caching_sha2_password认证,查看一下:

    完了,全TM完了......

    mysql> select user,host,plugin from mysql.user;
     ------------------ ----------- ----------------------- 
    | user             | host      | plugin                |
     ------------------ ----------- ----------------------- 
    | leo              | %         | caching_sha2_password |
    | mysql.infoschema | localhost | mysql_native_password |
    | mysql.session    | localhost | mysql_native_password |
    | mysql.sys        | localhost | mysql_native_password |
    | root             | localhost | caching_sha2_password |
     ------------------ ----------- ----------------------- 
    

    显然不可能一向update plugin,因为那恐怕招致加密的密码不能够被科学解密,你抱有的密码都会形成,由此除root@'localhost'外全部删掉重新建立。

    完了,全TM完了......

    先是要求在my.cnf里加多:default_authentication_plugin=mysql_native_password,然后service mysqld restart重启服务:

    大庭广众不能够直接update plugin,因为那或许导致加密的密码不恐怕被科学解密,你具有的密码都会产生,由此全部删掉重新构建,又得苦逼的来二回skip-grant-tables,何况你还亟需在my.cnf里加多:default_authentication_plugin=mysql_native_password,然后service mysqld restart重启服务,以下只演示leo客户的创办:

    mysql> drop user leo;Query OK, 0 rows affected mysql> flush privileges;Query OK, 0 rows affected mysql> create user leo identified by 'mysql';Query OK, 0 rows affected mysql> grant all on *.* to leo;Query OK, 0 rows affected $mysql -Vmysql Ver 14.14 Distrib 5.7.20, for Linux  using EditLine wrapper$ mysql -uleo -pmysql -h192.168.1.193mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 16Server version: 8.0.11 MySQL Community Server - GPLCopyright  2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql>
    
    mysql> drop user leo;
    Query OK, 0 rows affected (0.10 sec)
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
    mysql> create user leo identified by 'mysql';
    Query OK, 0 rows affected (0.02 sec)
    mysql> grant all on *.* to leo;
    Query OK, 0 rows affected (0.08 sec)
    
    $mysql -V
    mysql  Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using  EditLine wrapper
    $ mysql -uleo -pmysql -h192.168.1.193
    mysql: [Warning] Using a password on the command line interface can be insecure.
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 16
    Server version: 8.0.11 MySQL Community Server - GPL
    
    Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> 
    

    总结

    由来远程连接符合规律。

    如上所述是小编给大家介绍的MySql 8.0.11设置配置教程,希望对大家持有利于,假诺大家有别的疑问请给本身留言,作者会及时还原大家的。在那也特别谢谢大家对剧本之家网址的支持!

    本文由新葡亰496net发布于网络数据库,转载请注明出处:新葡亰496net:11装置配置,新版mysql搭建八线程主

    关键词:

上一篇:汤姆cat安装和构造进度,非安装版

下一篇:没有了