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