1. 數據導入時出現錯誤
Got a packet bigger than 'max_allowed_packet' bytes
通過終端進入mysql控制台
mysql>show VARIABLES like '%max_allowed_packet%';
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 4194304 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
mysql>set global max_allowed_packet = 1048576*100;
默認值4M大小
2. 簡便方式開啟MySQL遠程訪問服務
查看用戶訪問權限
mysql>use mysql;
Database changed
mysql> select host, user, password from user;
新建用戶方式
mysql>grant all on *.* to newUser@'%' identified by 'newPassword' with grant option; mysql>flush privileges;
root用戶授權方式
mysql>grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option; mysql>flush privileges;