Big Data quick way to insert MySQL via PHP

Source: Internet
Author: User

If your MySQL is installed through brew, then please

Vi/usr/local/cellar/mysql/5.6.23/my.cnf

Will

Max_allowed_packet = 64M

Write save and restart MySQL, then go to MySQL CLI to run

Show variables like ' Max_allowed_packet ';

You can see if the change was successful, and then write the PHP file:

$sql = "INSERT INTO Biao (column_name) values"; for ($i = 0; $i < 5000000; $i + +) {    $sql. = "(' value′),";}; $sql = substr ($sql, 0, strlen ($sql)-1); $connect _mysql->query ($sql);

Execute it and you'll see the results in the database.

Big Data quick way to insert MySQL via PHP

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.