MySQL additions and deletions--the increase

Source: Internet
Author: User

MySQL Add data 1, new database user

New Feiyu database user allows login at all IP addresses
mysql> create user ' Feiyu ' @ '% ' identified by ' 123 ';

New Guest database user allows all addresses to be logged in the 192.168.1 network segment
mysql> create user ' guest ' @ ' 192.168.1.% ' identified by ' 123 ';

Note: A new database user is created with the following login error as the default password error

There are two types of solutions: (below)
(1) This method can only resolve the normal user password logon does not error, but does not resolve the default password errors at all
First turn off the MySQL service

Add--skip-grant-tables at startup

(2) This method to modify the MySQL configuration file, you can completely resolve the default password error
Delete User-empty records in MySQL


2. New hehe Database

Create database name;

3, new table (two ways)

(1) New user table CREATE table name (field definition ...) under hehe database path;

(2) The new table is not in the current path and specifies the path to the Create tables library name. Table name (field definition ...);

4, add records in the table (two ways)

(1) in the current path of the user table, add the Zhangsan record

(2) The new Lisi record is not in the current path of the user table and specifies the path

5. New table structure (two ways)

(1) New phone field in the current path of user table
ALTER TABLE user add phone char (2);

(2) The new phone field is not in the current path of the user table and the specified path
ALTER TABLE Hehe.user add phone char (2);

6. Specify the storage engine when creating tables

Mysql>create Table table Name field engine= engine;

MySQL additions and deletions--the increase

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.