分类 Mysql 下的文章

1.Copy整个Mysql目录及数据文件到另一台电脑,路径跟原安装路径一致

2.环境变量添加path路径 指定到mysql 的bin目录,也可设置HOME,如下方:

新增系统变量MYSQL_HOME:安装目录
在PATH变量的最后面添加: ;%MYSQL_HOME%\bin(注意前面的;)

3.根据需要调整配置文件

4.注册服务

cmd 输入命令: mysqld --install mysql

5.启动服务 net start mysql

mysql迁移

Navicat连接后,发现原数据库都在,完美迁移。

Notes
For Connector/J 8.0.12 and earlier: In order to use the utf8mb4 character set for the connection, the server MUST be configured with character_set_server=utf8mb4; if that is not the case, when UTF-8 is used for characterEncoding in the connection string, it will map to the MySQL character set name utf8, which is an alias for utf8mb3.

For Connector/J 8.0.13 and later:

When UTF-8 is used for characterEncoding in the connection string, it maps to the MySQL character set name utf8mb4.

If the connection option connectionCollation is also set alongside characterEncoding and is incompatible with it, characterEncoding will be overridden with the encoding corresponding to connectionCollation.

Because there is no Java-style character set name for utfmb3 that you can use with the connection option charaterEncoding, the only way to use utf8mb3 as your connection character set is to use a utf8mb3 collation (for example, utf8_general_ci) for the connection option connectionCollation, which forces a utf8mb3 character set to be used, as explained in the last bullet.

官方手册链接:
https://dev.mysql.com/doc/connectors/en/connector-j-reference-charsets.html

提示
mysql-connector-java 版本在8.0.12之前的,包括8.0.12,服务端必须设置character_set_server=utf8mb4;如果不是的话,就算设置了characterEncoding=UTF-8,照样会被设置为MYSQL的 utf8字符集,也就是utf8mb3。

对于8.0.13和以后的版本,如果设置了characterEncoding=UTF-8,他会映射到MYSQL的utf8mb4字符集。

如果connectionCollation 也和characterEncoding一起设置了,但是不兼容,characterEncoding会被connectionCollation的设置覆盖掉。

由于没有Java-Style的utfmb3对应的字符集名称可以用在connection选项charaterEncoding上,唯一的设置utf8mb3的方式就是在连接选项设置utf8mb3 collation(例如utf8_general_ci),这会强制使用utf8mb3字符集,正如上文所述。

查看mysql字符集

show variables like 'char%'; show variables like 'collation%';

A:这是由于redo日志文件占用了空间,通常在2GB~11GB左右,最多时会占用11GB,其中包括缓冲池中8个redo日志(8G)、正在写的redo日志(1GB)、提前创建的redo日志(1GB)以及最后一个redo日志(1GB)。

缓冲池内的redo日志文件数量由参数loose_innodb_polar_log_file_max_reuse控制,默认值为8。您可以修改这个参数从而减少日志空间占用量,但在压力大的情况下,性能可能会出现周期性的小幅波动。

说明 调整参数loose_innodb_polar_log_file_max_reuse后,缓冲池不会立刻被清空,随着DML被执行,缓冲池内的数据量才会慢慢减少。如果需要立即清空,请提交工单联系售后服务。

PolarDB ib_logfile

免责声明
本博客部分内容来自于互联网,不代表作者的观点和立场,如若侵犯到您的权益,请联系[email protected]。我们会在24小时内进行删除。