Affiliates

mysql无法本地、外网同时访问 Host is not allowed to connect t

杀马特。学长 韩版系。学妹 提交于 2020-08-10 20:08:12
mysql无法外网连接 Host * is not allowed to connect to this MySQL server 在本机登入mysql后,更改"mysql"数据库里的"user"表里的"host"项,从"localhost"改为'%'。 代码如下 mysql> mysql>use mysql; mysql>select host from user where user='root'; mysql>update user set Host='%' where User='root'; #查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称) Linux中的mysql,user值为root的,有三条记录 修改了这条有密码的记录,重启mysql服务后,数据库能远程访问。 但是控制台就无法登录mysql了。 原因是,user表中其它几条记录影响了,全部删掉,只留下有密码的这一条记录即可。 2018年12月8日,客户用phpStudy,用了上述方法,只剩下一条root的,127.0.0.1无法登录,用localhost就可以登录,执行这个命令,其实就是在user表里添加一条记录 grant all privileges on . to 'root'@'127.0.0.1' identified by 'tXkj-8002-vErygood';

技术分享 | 如何优雅地在 Windows 上从 MySQL 5.6 升级到 5.7

妖精的绣舞 提交于 2020-08-09 17:26:20
作者:赵黎明 爱可生 MySQL DBA 团队成员,Oracle 10g OCM,MySQL 5.7 OCP,擅长数据库性能问题诊断、事务与锁问题的分析等,负责处理客户 MySQL 及我司自研 DMP 平台日常运维中的问题,对开源数据库相关技术非常感兴趣。 本文来源:原创投稿 *爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。 本文关键字:升级、Windows、账号管理 背景 最近有去某客户那里支持 MySQL 实例升级,他们的实例版本比较多,有 5.5、5.6、5.7,外加各种小版本,平台也很多,有 Linux、Windows。对于 Unix/Linux 平台的 MySQL 版本升级,大家可能再熟悉不过了,但对于 windows 平台的,可能接触地较少。由于项目上有需求,自己也在 Windows 环境上测试了一把,有了些心得,想跟大家分享一些经验,于是有了本文。这里主要是针对比较常见的 5.6 到 5.7 的升级。 限制 MySQL 官方提供了 2 种介质的升级方式:一种是 MySQL Installer 的方式(需要下载 MSI 可执行程序,进行图形化安装),另一种则是 noinstall zip 包的方式(就是我们熟悉的绿色软件,解压即用的那种,当然 MySQL 作为数据库软件,也没傻瓜到那种程度,还是需要一些额外操作的),推荐使用第 2 种方式

mysql Ignoring query to other database

南楼画角 提交于 2020-08-06 10:16:02
mysql 碰到了Ignoring query to other database问题: root@support ~]# mysql -root -p --socket=/tmp/mysql.sock Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.22-log Source distribution Copyright (c) 2000, 2011, 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 databases; Ignoring query to other database

树莓派4B使用docker安装mysql5.7.30

感情迁移 提交于 2020-08-06 09:54:23
硬件 :Raspberry Pi 4B(4g或8g版本) 系统 :Ubuntu 20.04 LTS Docker :18.09.9 mysql镜像 :biarms/mysql:5.7.30-linux-arm64v8 注意 :因为我们树莓派4B本身并非x86,而是arm架构,且我们的系统装的是64位ubuntu,因此镜像只能选择arm64v8架构的镜像。 配置文件 :/home/docker/server/mysql/my.cnf [mysqld] ## server_id=1 ## binlog-ignore-db=mysql ## log-bin=replicas-mysql-bin ## binlog_cache_size=1M ## binlog_format=mixed ## expire_logs_days=7 max_allowed_packet=125M max_connections=200 max_connect_errors=10000 datadir =/opt/mysql/data socket =/opt/mysql/data/mysql.sock #Encoding collation-server = utf8_unicode_ci init-connect='SET NAMES utf8' character-set-server = utf8

Linux命令:MySQL系列之十--MySQL用户和权限管理,mysql管理员密码重置

送分小仙女□ 提交于 2020-08-05 23:27:02
MySQL用户账号包括:用户名@主机名 用户名: 16个字符以内 主机: 主机有以下几种表现方式 主机名: mysql IP地址: 172.16.90.111 网络地址:172.16.0.0/255.255.0.0 通配符:%,_ %:任意字符 _:任意一个 172.16.%.% %.magedu.com 权限级别: 全局级别、库级别、表级别、列级别、存储过程和存储函数级别 全局级别:SELECT * FROM db\G; 查询全局库级别的权限 ************************************************************************** CREATE USER username@host [IDENTIFIED BY 'password'] 创建用户 DROP USER 'username'@'host'; 刪除用戶 RENAME USER old_name TO new_name; 重命名用戶 SHOW GRANTS FOR 'username'@'host'; 查看用户权限列表 FLUSH PRIVILEGES ; 刷新权限列表 GRANT PRIVILEGES ON [object_type] db.* TO 'username'@'host'; 给用户增加权限 REVOKE SELECT ON db.* FROM

Docker启动 mysql8

北慕城南 提交于 2020-07-27 15:03:49
1. 创建MYSQL8 docker run -it -d -p 3328:3306 --name docker_8_3328_mysql -e MYSQL_ROOT_PASSWORD=密码 --privileged=true --restart always -d mysql:8 2.添加防火墙端口 firewall-cmd --permanent --zone=public --add-port=3328/tcp 3.进入docker容器修改密码 docker exec -it 5160bdcd9252 bash 4.修改docker容器mysql信息 root@5160bdcd9252:/# mysql -uroot -p密码 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 48 Server version: 8.0.20 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates.

mysql重置密码和mysql error 1044(42000)错误

南楼画角 提交于 2020-05-08 04:06:22
#mysql错误:(密码不正确,需要重置密码) ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) #编辑配置文件 [root@m1 mysql]# vi /roobo/server/mysql/my.cnf [mysqld] skip-grant-tables #修改完后重启服务 [root@m1 mysql]# /etc/init.d/mysqld restart #登录数据库 [root@m1 mysql]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.24-log Source distribution Copyright (c) 2000, 2015, 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

监控EXPDP/IMPDP进度

坚强是说给别人听的谎言 提交于 2020-05-04 02:48:32
--获取JOB_NAME select * from DBA_DATAPUMP_JOBS; OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS -------------------- ------------------------------ -------------------- -------------------- ------------------------------ ---------- ----------------- ----------------- SYSTEM SYS_IMPORT_SCHEMA_01 IMPORT SCHEMA EXECUTING 1 0 2 1 row selected. --使用attach参数 impdp system/*** attach=SYS_IMPORT_SCHEMA_01 expdp system/*** attach=SYS_IMPORT_SCHEMA_01 [oracle@test ~]$ impdp system/qwer1234 attach=SYS_IMPORT_SCHEMA_01 Import: Release 11.2.0.4.0 - Production on Thu Jan

普通用户 要导整个数据库需要 什么权限?

怎甘沉沦 提交于 2020-05-04 02:43:35
普通用户 hr进行expdp数据导出,报权限不够的错误 [oracle@dbserver ~]$ expdp hr/hr directory=exp_dir dumpfile=full.dmp full=y Export: Release 11.2.0.4.0 - Production on Fri Oct 31 17:49:00 2014 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORA-31631: privileges are required ORA-39161: Full database jobs require privileges 报错了,主要是 hr用户没有 exp_full_database角色。 重新授予权限后, sql> GRANT EXP_FULL_DATABASE TO hr; 问题搞定 [oracle@dbserver ~

安装mysql5.7与创建用户和远程登录授权

只谈情不闲聊 提交于 2020-05-02 02:16:40
环境:ubuntu18.04 参考文章:安装并远程登录授权: https://www.cnblogs.com/chancy/p/9444187.html     用户管理: https://www.cnblogs.com/wanghetao/p/3806888.html     添加docker用户: https://www.jb51.net/article/115422.htm Ubuntu18.04安装mysql5.7 1.1安装 首先执行下面三条命令: # 安装mysql服务 sudo apt-get install mysql-server # 安装客户端 sudo apt install mysql-client # 安装依赖 sudo apt install libmysqlclient-dev # 检查状态 sudo netstat -tap | grep mysql 1.2设置root密码 mysql5.7安装完成后普通用户不能进mysql,原因:root的plugin被修改成了auth_socket,用密码登陆的plugin应该是mysql_native_password,直接用root权限登录就不用密码,修改root密码和登录验证方式: $ sudo su # mysql mysql> mysql> select user, plugin from mysql