在路上
发表于|更新于|在路上
|浏览量:
在路上
文章作者: Johnson Lin
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Johnson Lin!
相关推荐
2024-07-31
How to View MySQL Version: A Quick Guide
As a web developer or database administrator, knowing the version of MySQL you’re working with is crucial for ensuring compatibility with your applications, understanding the features available, and planning for upgrades. In this quick guide, I’ll show you how to view the MySQL version using several different methods. 1. Using the MySQL Command LineIf you have access to the MySQL command line, the easiest way to check the version is by logging in and running a simple command. Here’s how: Ope...
2022-04-05
Centos7安装MySQL 5.7 步骤(yum安装)
一、添加 yum 源下载 MySQL 5.7 rpm 包: 1wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm 安装 rpm 包: 1sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm 完成后会在 /etc/yum.repos.d/ 目录下生成两个repo文件: mysql-community.repo、 mysql-community-source.repo 二、安装 MySQL进入 /etc/yum.repos.d 目录: 1cd /etc/yum.repos.d/ 执行 yum 安装命令: 1sudo yum install mysql-server 安装过程中,会有提示确认信息,一般一路输入 y 即可。 如果显示以下输出,则表明安装已成功。 1234567Installed: mysql-community-server.x86_64 0:5.7.37-1.el7Dependency Installed: my...

2023-09-26
慢慢变富
Iuo

2023-09-26
解决MySQL 8中“Public Key Retrieval is not allowed”问题
问题从 MySQL 8 开始,身份验证插件更改为“caching_sha2_password”。因此,使用 JDBC 或其他客户端工具连接 MySQL 时,可能会遇到“Public Key Retrieval is not allowed”的问题。 1Public Key Retrieval is not allowed 解决方案一在连接 MySQL 时,设置以下参数,允许客户端自动向服务器请求公钥。1allowPublicKeyRetrieval=true如:1jdbc:mysql://localhost:3306/mysql_database?useSSL=false&allowPublicKeyRetrieval=true 解决方案二我们可以将身份验证插件更改回“mysql_native_password”来解决该问题。 在终端中执行以下命令以使用 root 用户登录 MySQL: 1$ mysql -u root -p 进入mysql数据库: 1mysql> use mysql; 查看当前用户表中的 host 和用户信息: 1mysql>...

2019-08-18
MySQL多表更新(关联表更新)
在开发过程中,有时会遇到需要将某张表的字段值根据条件动态地更新到另一张表字段的问题,即通过一张表的字段修改另一张关联表中的内容。比如,存在两张表A(表名:test_a)、B(表名:test_b),他们的表结构如下: 表A(test_a): id user_id dept_id update_time 1 34242 313 2 35322 320 3 35639 321 表B(test_b): id user_id patient_id dept_id create_time 1 34242 342 0 2018-05-23 09:33:45 2 35322 365 0 2018-05-24 00:13:05 3 35639 398 0 2018-05-24 00:43:18 现在我们需要将表A的 dept_id 字段值根据 user_id 字段同步到表B的 dept_id 字段中,即用表A中的 dept_id 字段数据去更新表B中的 dept_id 字段,条件是表A的 user_id 字段值与表B的 user...

2022-10-21
MySQL如何开启binlog日志
查看是否开启binlog日志连接 MySQL,执行以下命令: 1show variables like 'log_%'; 查询结果类似以下内容: Variable_name Value log_bin OFF log_bin_basename log_bin_index … 变量 log_bin 的值为 OFF,说明未开启 binlog 日志,若为 ON 说明已开启。 开启binlog日志若 MySQL 未开启 binlog 日志,可通过修改 MySQL 的配置文件 mysqld.cnf 启用 binlog 日志。 打开配置文件(注意:配置文件位置需改为你自己的存放位置): 1vim /etc/mysql/mysql.conf.d/mysqld.cnf 添加以下配置项: 123server_id = 20log_bin = mysql-binbinlog_format = ROW 保存修改内容,并重新启动 MySQL 使修改后的配置项生效,如使用 service 命令重启: 1servic...


