Mysql-mysql Initial involvement

Source: Internet
Author: User

MySQL is an open source database management system.

C:\Program Files\mysql\mysql Server 5.7

Manually modify the MySQL server configuration mysql.ini[client]  database client configuration Port=3306default-character-set=utf8[mysqld]  database service configuration port= 3306basedir= "C:/Program files/mysql/mysql server 5.5/"     Database installation path datadir= "C:/programdata/mysql/mysql Server 5.5/ data/"The  file path where the database stores data Character-set-server=utf8default-storage-engine=innodb

About the CMD interface cannot start mysql:1. You must run CMD Program 2 with administrator. If you download the MySQL5.7 version, the name of MySQL on the Windows service defaults to MySQL57, so running net start/stop mysql in cmd is invalid and must be changed to net Start/stop mysql57.


Modifying the MySQL prompt: 2 ways (1) When connecting clients by specifying the shell> Mysql-uroot-proot--prompt prompt (2) after connecting to the client, modify the Mysql>prompt prompt by prompt command

MySQL statement specification: ① keyword and function name all uppercase ② database name, table name, field name all lowercase ③sql statement must end with a semicolon common statement select VERSION (); Query the current server version select Now (); Query Current date Time select USER (); Querying the current user

Operation database One, database creation: Create 1, Syntax: create {database | SCHEMA} [IF not EXISTS] db_name [DEFAULT] CHARACTER SET [=] charset_name. 2, the database and the schema is the same, optionally one 3, if not EXISTS: if the creation of the database exists, then not only reported warning, not write error 4, Chrarcter set GBK: Set the table encoding method, If not set then use MySQL default encoding method Two, view the database list: Show 1, show {database | SCHEMAS} [like ' Pattern ' | WHERE Expr] 2, show CREATE database xx: show XX databases information
Third, the database modification: Alter 1, modify the database encoding method: Alter {database | SCHEMAS} [Db_name][default] CHARACTER SET [=] charset_name iv. Delete database: Drop 1, delete database: drop {db | SCHEMAS} [IF EXISTS] db_name;mysql-uroot-proot prompt \d--Modify MySQL operator to current date show databases--show all databases CREATE DATABASE IF No T exists T1 character set GBK; --Create DATABASE show create databases T1; --Display the creation command and encoding form of database T1--Modify database encoding format alter databases T2 character set =utf8;--delete database drop DB if exists t1;--display warning message show Warnings

Mysql-mysql Initial involvement

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.