当前位置:Gxlcms > 数据库问题 > Linux下安装二进制版mysql-8.0.15

Linux下安装二进制版mysql-8.0.15

时间:2021-07-01 10:21:17 帮助过:15人阅读


技术图片
mysql -udfs -p -S /data/mysql/mysql-8.0.15/tmp/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.12 MySQL Community Server - GPL
Copyright (c) 2000, 2018, 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> select version();
+-----------+
| version() |
+-----------+
| 8.0.12 |
+-----------+
1 row in set (0.00 sec)
技术图片
7.设置可以远程登录的账号:
mysql> show variables like ‘%valid%pass%‘;
Empty set (0.00 sec)
mysql> create user root@‘%‘ identified by ‘oracle‘;
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> show variables like ‘%valid%pass%‘;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
## 因为默认有一个root帐号,所以上面创建root会报错,只需修改其密码和权限即可
mysql> alter user root@‘localhost‘ identified by ‘oracle‘;
--创建可以远程登录的用户:
mysql> create user root@‘%‘ identified by ‘oracle‘;
Query OK, 0 rows affected (0.06 sec)
mysql> grant all privileges on *.* to root@‘%‘ with grant option;
Query OK, 0 rows affected (0.07 sec)
mysql> grant all privileges on *.* to root@‘localhost‘ with grant option;
Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
注意:
上面创建mysql用户后,在远程连接mysql时可能会出出验证问题,在mysql8版本中可能是验证方式有所改变,如果报如下图中的错误,执行后面给出的命令即可

技术图片
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘oracle‘;
ALTER USER ‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘oracle‘;
flush privileges;

 

Linux下安装二进制版mysql-8.0.15

标签:输入   ror   验证方式   serve   add   mat   mysql用户   option   input   

人气教程排行