Database MySQL Learning (i)

Source: Internet
Author: User
Tags create database

Database: A warehouse in which data is stored and managed according to data structures.

MySQL is a relational database management system

After MySQL is installed ...

MySQL Start-up

1: Find MySQL Right-click on "Services" in the control Panel to start

2: Start menu search cmd and then right-click Admin start input "net start mysql80" to start

Turn off input "net stop mysql80"

Then, when you're done, log in to MySQL.

Parameters for MySQL:

-U: User name

-P: Password

-V: Output version information

-H: Host address

For example, after booting in DOS input "mysql-u (user name)-p (password)" Enter can enter

If you exit, you can enter "Exit" or "quit" or "Q" directly.

Common commands for MySQL

To modify a user password:

Mysqladmin-u (username)-p (old password) password new password

Show Database Commands

show databases; (note semicolon)

Working with databases:

Use MySQL;

After entering a database, use the Select command to display information about the current connection

Displays the currently connected database: Select database ();

Display Server version: select version ();

Show current date Time: select Now ();

Show Current User: Select User ();

Next is the operation of the database

Create a database

Syntax format: CREATE DATABASE [IF not EXISTS] Db_name

[DEFAULT] CHARACTER Set[=]charset_name

The most basic Create database (name);

or create database if not EXISTS (DB name) character set Utf-8;

Modify Database

ALTER DATABASE (first name) character set (new setting);

Deleting a database

Drop database (if exitsts) (name);

 

Database MySQL Learning (i)

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.