root@c29fa91db6a2:/opt/hive/conf# mysql -uroot -ppassword
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 205
Server version: 5.7.25-0ubuntu0.18.04.2 (Ubuntu)
Copyright (c) 2000,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> show grants;
+---------------------------------------------------------------------+
| Grants for root@localhost |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql>
我究竟做错了什么?为了在Docker容器内使用配置单元,我还需要做什么?
另外,我看到mysql正在运行
root@7bfa781e1a2c:/opt/hive/conf# ps aux | grep mysql
mysql 1931 0.0 0.0 4624 1768 ? S 20:19 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 2282 0.2 8.7 1416908 179700 ? Sl 20:19 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 --log-syslog=1 --log-syslog-facility=daemon --log-syslog-tag=
root 2594 0.0 0.0 11460 1084 pts/1 S+ 20:24 0:00 grep --color=auto mysql
root@7bfa781e1a2c:/opt/hive/conf#
最佳答案
有几个问题需要解决:
> mysql安装随附的默认root用户使用auth_socket作为身份验证插件.这意味着它没有密码.尝试使用mysql -uroot登录,它仍然会登录.
mysql> select * from mysql.userG
*************************** 1. row ***************************
Host: localhost
User: root
Select_priv: Y
Insert_priv: Y
Update_priv: Y
Delete_priv: Y
Create_priv: Y
Drop_priv: Y
Reload_priv: Y
Shutdown_priv: Y
Process_priv: Y
File_priv: Y
Grant_priv: Y
References_priv: Y
Index_priv: Y
Alter_priv: Y
Show_db_priv: Y
Super_priv: Y
Create_tmp_table_priv: Y
Lock_tables_priv: Y
Execute_priv: Y
Repl_slave_priv: Y
Repl_client_priv: Y
Create_view_priv: Y
Show_view_priv: Y
Create_routine_priv: Y
Alter_routine_priv: Y
Create_user_priv: Y
Event_priv: Y
Trigger_priv: Y
Create_tablespace_priv: Y
ssl_type:
ssl_cipher:
x509_issuer:
x509_subject:
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
plugin: auth_socket
authentication_string:
password_expired: N
password_last_changed: 2019-04-03 07:43:20
password_lifetime: NULL
account_locked: N
>因此,在mysql中进行任何更改之前,配置单元服务会引发以下错误:
由以下原因引起:java.sql.SQLException:用户’root’@’localhost’的访问被拒绝
(编辑:网站开发网_安阳站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|