Working with MySQL database steps in the console and a few minor issues

Source: Internet
Author: User

has been using Navicat to operate the MySQL database, today suddenly want to try the DOS console to operate, special record their first use experience, if there are errors, but also look at the big boys pointing.

First open the console, Win+r key, enter CMD, determine

Input mysql-uroot-p123456

where root represents your user name, 123456 is your database password

If successful, the following interface appears

then enter show databases; (note the plural, and do not forget the semicolon), the name of your database appears,

After that, ues + the database name you want to manipulate, such as use

Next look at what tables the current database has, enter the command show tables; (also note the plural form and semicolon)

Next, you can perform SQL statement operations on the table, such as query operations,SELECT * from phonebook; ( semicolon!) Semicolon! Semicolon! Don't forget to add a semicolon after the SQL statement )

Finally, a few FAQs

1, Chinese can not display properly

WORKAROUND: Use the command show variables like ' char% '; view encoding

Use the command set character_set_results=gb2312;

This allows you to display the operation as normal.

2, the field is too many, DOS window display problem

Workaround: Add \g after the SQL statement to display the records in a stripe.

Working with MySQL database steps in the console and a few minor issues

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.