Garbled solution occurs when importing to Mysql database via command line _mysql

Source: Internet
Author: User
Tags cpanel

Solution:

Open the SQL file and add the following in the first line of the SQL file

/*!40101 SET NAMES UTF8 * *;

Save SQL file as UTF-8 NO BOM format

Upload the SQL file via FTP, and put it in the root directory.

Enter your cpanel, see the Cron Jobs icon, click In, and then select Advanced (Unix Style)

Because only need to run once, so minute, Hour, day, Month all fill in ready to run the specific time, leave two minutes margin on the line (if the virtual host is not local, you can check the host time on the FTP), weekday fill * No. command to fill in the commands to be run, the import command:
Mysql-u User name-p password [h database host] Database < database backup. sql

Suppose the IP of the remote host is: 10.0.0.1, the username is root, and the password is 123. Type the following command:

Mysql-h10.0.0.1-uroot-p123

Note:
You can have no space with root, and the rest is the same. For example, my settings are as follows:

Mysql-ucpanel123_cpuser-pcpanel-hlocalhost CPANEL123_CP  

Then check the import in the phpMyAdmin. This way to import SQL files quickly, I wish you success.

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.