1.mysql-proxy配置

mysql-proxy.cnf文件配置

Key file does not start with a group
原因:mysql-proxy.cnf文件中缺少[mysql-proxy]行
解决方法:在文件中添加“[mysql-proxy]”

2.mysql命令

You are not allowed to create a user with GRANT
原因:当前user表中没有root - %记录; 可以更新root - localhost 为 root - %
解决方法: update user set host = ‘%’ where user = ‘root’;
ERROR 1062 (23000): Duplicate entry ‘%-root’ for key ‘PRIMARY’
原因显示:host+user 应该是联合主键,冲突了
解决方法:update user set host = ‘%’ where user = ‘root’ and host=’localhost’;
netstat -aptn 查看端口

3.database is uninitialized and password option is not specified

docker run —name mysql_test -it -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=root mysql:8.0.17

4.Failed to get D-Bus connection: Operation not permitted

Docker的设计理念是在容器里面不运行后台服务,容器本身就是宿主机上的一个独立的主进程,也可以间接的理解为就是容器里运行服务的应用进程。一个容器的生命周期是围绕这个主进程存在的,所以正确的使用容器方法是将里面的服务运行在前台。
再说到systemd,这个套件已经成为主流Linux发行版(比如CentOS7、Ubuntu14+)默认的服务管理,取代了传统的SystemV风格服务管理。systemd维护系统服务程序,它需要特权去会访问Linux内核。而容器并不是一个完整的操作系统,只有一个文件系统,而且默认启动只是普通用户这样的权限访问Linux内核,也就是没有特权,所以自然就用不了!
因此,请遵守容器设计原则,一个容器里运行一个前台服务!

我就想这样运行,难道解决不了吗?
答:可以,以特权模式运行容器。

docker run -d —name centos7 —privileged=true centos:7 /usr/sbin/init

5.1130 - Host ‘gateway’ is not allowed to connect to this MySQL server

  遇到这个问题首先到mysql所在的服务器上用连接进行处理
  1、连接服务器: mysql -u root -p
  2、看当前所有数据库:show databases;
  3、进入mysql数据库:use mysql;
  4、查看mysql数据库中所有的表:show tables;
  5、查看user表中的数据:select Host, User,Password from user;
  6、修改user表中的Host:update user set Host=’%’ where User=’root’;
  7、最后刷新一下:flush privileges;
update user set password=password(‘123456‘) where user=‘root‘;

6.ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

密码的长度是由validate_password_length决定的,但是可以通过以下命令修改

  1. set global validate_password_length=4;
  2. 1

validate_password_policy决定密码的验证策略,默认等级为MEDIUM(中等),可通过以下命令修改为LOW(低)

set global validate_password_policy=0;

7.ERROR 1410 (42000): You are not allowed to create a user with GRANT

update user set host=’%’ where user=’test’;

Grant all privileges on test.* to ‘test’@’%’;

8.error: Failed dependencies:……

依赖关系非常复杂,当你试图先安装任何一个包时都会出现这样的依赖关系错误,这时候你就应该强制安装了,我认为只要你把服务或软件需要的包都装上,强制安装也不会出问题的,不会有什么影响。
非常简单,只要加上一个—force (强制) 和—nodeps(不查找依赖关系)就可以了
如:rpm -vih httpd-2.2.3-6.el5.i386.rpm —force —nodeps
卸载时就不用—force了,只要加入—nodeps就ok了

ERROR 1251 (08004): Client does not support authentication protocol requested by server; consider upgrading MySQL client

ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘xgywxybmCHVrq7f7zGda’;
FLUSH PRIVILEGES;

FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
Data::Dumper

image.png