MySQL Database
First, Introduction:
MySQL is the database management software: Sockets: Server, Client
- Support concurrency, operation is to share data
- Handling locks, data security, performance
- Use other people's software, according to the norms of others, organize their own grammatical rules
Ii. Overview:
- Database server: The computer running the database management software
- Database management software: Mysql,oracle,db2,slqserver
- Libraries: Folders
- Table: Files
- Record: A series of typical features of a thing: Egon,male,18,oldgirl
- Data: Symbols describing the characteristics of a thing
Three, MySQL introduction:
MySQL is a relational database management system developed by the Swedish MySQL AB company, currently owned by the Oracle company.
What is MySQL
MySQL is a software based on the C/s architecture of socket writing
Client software
MySQL comes with: such as MySQL command, mysqldump command, etc.
Python modules: such as Pymysql
Iv. Classification of database management software:
There are two main types of:
- Relationship type: As Sqllite,db2,oracle,access,sql server,mysql, NOTE: SQL statements are common
- Non-relational: Mongodb,redis,memcache
Can be simply understood as:
- Relational database requires a table structure, table structure = field + data type + constraints
- The non-relational database is key-value stored, without a table structure
V. Download and installation of MySQL
Download and installation of Windows systems:
1. Download
www.mysql.org-->downloads-->community--> Download 5.6 Microsoft Windows
2. Unzip
Install MySQL in the specified directory, such as: C:\mysql56
3. Add Environment variables
"Right-click Computer"-"Properties"-"Advanced system Settings"-"Advanced" and "Environment variables"-"System variable Path new"-"Add C:\mysql56\bin"
4. Start cmd
>>>:mysqld #服务端
>>>:mysql #客户端
5. Make MySQL system service, boot up automatically
1. First kill the previously opened Mysqld:
- In system command input: tasklist | findstr MySQL view process ID
- Terminate process: taskkill/f/pid 7464 #进程号
2. Production System Services
Run cmd as an administrator
- MYSQLD--install Production System Services
- MYSQLD--remove Decommissioning System Services
3. Start the service
Run cmd as an administrator
- NET start MySQL startup service
- net stop MySQL stop service
6. Verify that it is successful
Input: MySQL
7. Admin user root default no password, set password, change password
- Set Initial password: mysqladmin-uroot-p password "123"
- Modify user password: mysqladmin-uroot-p123 password "456"
8. Break the user password and skip the authorization form:
Run cmd as an administrator:
- Stop MySQL service: net stop MySQL
- Skip Authorization form: Mysqld--skip-grant-tables
Normal User run cmd:
- Input: Mysql-uroot-p #跳过了授权不用输入密码
- Input: Update mysql.user set Password=password ("123") where user= "root" and host= "localhost"; #修改密码
- Input: Flush privileges; #刷新授权表
- Input: tasklist | findstr MySQL #查看进程id
Run cmd as an administrator:
- Input: taskkill/f/pid 7464 #杀死进程
- Input: net start mysql# start M with SQL service
- Input: Mysql-uroot-p123 # with previously modified password
9. Two ways to log in to the user
Mysql-uroot-p123
Mysql-uroot-p123-h 127.0.0.1-p 3306 #默认端口是3306
Ten . Set the default encoding
Create the My.ini file in the MySQL file directory I add
#mysql5. More than 5: Modification method changed [Mysqld]character-set-server=utf8collation-server=utf8_general_ci[client] Default-character-set=utf8[mysql]default-character-set=utf8
Introduction and installation of database---MySQL