mysql + unload heavy equipment failed to import large amounts of data solutions + different tools to perform and project results

 

 

 

 

 

 

1. Uninstall

1 "shortcut win + r type regedit into the registry

  Find three folders, delete all

1、
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL
2、
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL
3、
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL

2 "shortcut win + r enter services.msc into the service list

  Find the relevant mysql, closed

3 "Delete mysql installation location

  Usually three places, you can directly delete folders

1、
C:\Program Files\MySQL
2、
C:\Program Files (x86)\MySQL 
3、
C:\ProgramData\MySQL

4 "Close all programs, restart the computer before installing

2, reloading

1 "from the official website to download the installation file https://dev.mysql.com/downloads/

  2 "All default on it, all the way to set a password, root account when

3, into mysql:

    cmd到bin目录下,然后点击:
    mysql -hlocalhost -uroot -p
    123456
    即可进入

4、mysql导入大量数据失败

  1》本次生效

##查看限制项
SHOW VARIABLES LIKE '%max_allowed_packet%';
##设置限制项为100M
SET GLOBAL max_allowed_packet = 100 * 1024 * 1024;
##查看mysql的版本号
SELECT VERSION();

  2》永久生效

1、找到my.cnf,在这里配置
有的直接在mysql的目录下
有的在C:\ProgramData\MySQL
2、在[mysqld]段或者mysql的server配置段进行修改。
max_allowed_packet = 20M
3、在cmd中输入services.msc,自动跳转到服务界面中,选择重启MySQL

5、有时会出现在sqlyog里的执行是有结果的,但是在使用Java项目去执行相同的sql语句时,却查不出结果。一般要考虑编码的问题

解决方法:再配置文件里增加url的配置或者修改url的配置

url=jdbc:mysql://127.0.0.1:3306/数据库名称?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8

 

Guess you like

Origin www.cnblogs.com/dhrwawa/p/11347701.html