Several dots in MySQL

Source: Internet
Author: User
Document directory
  • 1. Enter the MySQL command to log on without entering the user name and password.
  • 2. display the name of the database for the current operation to prevent misoperation.
  • 3. Import text data
1. Enter the MySQL command to log on without entering the user name and password.

The configuration method is as follows. Create the file. My. CnF in the current directory of the user (my system is ubuntu12.10, note that there is a point in front of the file), and enter the following content to save it. Then open the terminal and enter MySQL to log on automatically.

[Client]
Host = localhost
Port = 3306
User = ssj (this is the MySQL user name)
Password = ssjpasswd (this is the password)

Database = test (test is the database name)

Loose-local-infile = 1 (to support importing text data)

2. display the name of the database for the current operation to prevent misoperation.

Enter prompt MySQL [\ D]> In the mysql client command line. When the database is set to test, the command line prompt changes from mysql> to MySQL [test]>

3. import text data. For example, if the text data is zhangsan 20 Lisi 30, the created table MT is create table mt (name varchar (10), age INT). You can use the following command to import the data. Load data local infile 'test.txt 'into Table Mt fields terminated by ''; # Fields terminated by'' indicates that fields are separated by spaces. Note: If the preceding client configuration is used, you may be prompted that the load data command cannot be found. Add loose-local-infile = 1.

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.