Mysql study notes -- 1st days _ MySQL

Source: Internet
Author: User
Mysql study Notes-1st Days 1. accounts, images, and articles on webpages are stored in the database
2. Oracle, DB2, SQL server, and other multi-clock databases
Use mysql PHP + mysql prime partner in PHP
PHP and mysql are both open-source, free and practical, and well configured.
Mysql is suitable for small and medium businesses, but not powerful in Oracle.
3. mysql architecture: C/S client/server
Enable on server and operate on client
Mysql DBMS (DB stands for database M stands for management S stands for system)
Client operation server --- database -- Data table -- (row (record), row (field ))
4. mysql to be learned by programmers
1. design a table for your project
2. use SQL statements (SQL programming-connection, adding, deleting, modifying, and querying data)
You can use the tool.
5. install mysql and integrate with php
Directory structure: my. ini configuration file: modify the port, character set, and so on.

Startup server: (1) self-built startup Portal (2) computer management/service/find mysql service to start
(3) run the cmd command to start the service: net strat/stop/restrat mysql.
In linux, it is service mysqld strat.
Configure the environment variable: the computer property matches the environment variable path. Put the corresponding directory in the variable value of path.
Paths are separated by semicolons. Search for the command in the path under the cmd command line
6. Database SQL statement operations
Structured Query language)
DDL table creation
Add, delete, modify, and query DML data operations
DQL data query
DCL data control statement (management permission, data change)
1. execute SQL statements and link them to the database server.
Cmd command: mysql-h (address) IP address/local Machine: localhost-u (specified user) root-p123456 (password)
Mysql> exit
To retain an administrator user
DDL:
Create database liangcha (database name)
Drop database liangcha (delete database) (equivalent to creating and deleting a folder)
Create database if not exists liangcha
Create table liangcha user (id int, name char <30> );
Select a database as the default database for easy operation
Use liangcha;
Show database/table; (view)
DML:
Insert into user (id, name) values <1, 'Zhang San'>
Updata user set name = 'Lili' where id = '1' (change the name with id 1 to lili)
Delete from user where id = '1' (delete) where = operation condition
DQL:
Select * from user (query table)
DCL:
/S view status
Show databases view all databases
Show tables
Desc view table structure
Variables in the show varlable configuration file

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.