Mysql learning practices --- Basic settings, mysql learning practices ---

Source: Internet
Author: User
Tags mysql commands

Mysql learning practices --- Basic settings, mysql learning practices ---

This article is MOOC network MySql study notes, address: http://www.imooc.com/learn/122

1. Configure the default Character Set utf8 in my. ini

A. Client: [mysql]Default-character-set = utf8

  B. server: [mysqld] character-set-server = utf8

Ii. Start and Stop the mysql Service

A. in windows, choose Computer Management> services> mysql, right-click to start or stop

B. Run the command to open cmd and start the service using net start mysql. Use net stop mysql to stop the service.

Iii. log on and exit

A. logon Parameters

  

B. exit mode: exit; or quit; or \ q;

4. Modify the mysql prompt (\ D -- complete date, \ d -- current database, \ h -- server name, \ u -- current user. Eg: \ u @ \ h \ d)

A. When logging on to the service, for example, mysql-uroot-p -- prompt

B. Use the prompt after logon;

V. Common mysql commands

A. view the current VERSION: select version ();

B. view the current date and time: SELECT NOW (); view the current date: SELECT CURDATE (); view the current time: SELECT CURTIME ();

C. view the current logon USER: select user ();

D. view the warning information: show warnings;

E. view the DATABASE creation Information: show create database dbname;

F. view the TABLE creation Information: show create table tablename \ G; (\ G indicates formatting output result information, SELECT * FROM tablename \ G; indicates printing TABLE data by column)

Vi. mysql statement specifications

A. All keywords and function names are capitalized.

B. The database name, table name, and field name are all in lowercase.

C. Each SQL data must end;

7. Create a database (mandatory for braces and optional for brackets)

  

8. Modify the database Character Set

  

9. delete a database

  

 

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.