Database---mysql introduction and installation

MySQL database

1. Introduction:

mysql is database management software: socket: server, client

  • Supports concurrency; operates on shared data
  • Handling locks, data security, performance
  • Using other people's software, you have to organize your own grammar rules according to other people's norms

2. Overview:

  • Database server: A computer running database management software
  • Database management software: mysql, oracle, db2, slqserver
  • library: folder
  • Table: Documents
  • Record: A series of typical characteristics of things: egon, male, 18, oldgirl
  • data: symbols that describe the characteristics of things

3. Introduction to MySQL:

MySQL is a relational database management system developed by the Swedish MySQL AB company and is currently owned by Oracle.

what is mysql

       mysql is a C/S architecture software written based on socket

       Client software

              mysql comes with: such as mysql command, mysqldump command, etc.

              python module: such as pymysql

Four, database management software classification:

There are two categories:

  • Relational type: such as sqllite, db2, oracle, access, sql server, MySQL, note: sql statements are common
  • Non-relational: mongodb, redis, memcache

It can be simply understood as:

  • Relational databases need a table structure, table structure = fields + data types + constraints
  • Non-relational databases are key-value storage and have no table structure

Five, MySQL download and installation

Windows system download and installation:

 

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]-->[Environment Variables]-->[System Variable Path New] --> [Add C:\mysql56\ bin] 4. Start cmd >>>:mysqld #Server >>>:mysql #Client
5. Make mysql a system service and start automatically when booting
1. Kill the mysqld that was started before:
Enter in the system command: tasklist | findstr mysql View the process id
Terminate the process: taskkill /F /PID 7464 #Process ID
2. Make system service)
Run cmd
mysqld --install as administrator to make system service
mysqld --remove to remove system service
3. Start service
Run cmd
net start MySQL as administrator to start service
net stop MySQL to stop service

6. Verify that the installation was successful



7.管理用户root默认没有密码,设置密码,修改密码
设置初始密码:mysqladmin -uroot -p password "123"
修改用户密码:mysqladmin -uroot -p123 password "456"

8.破解用户密码,跳过授权表:
以管理员的身份运行cmd:
停止MySQL服务:net stop MySQL
跳过授权表: mysqld --skip-grant-tables

正常用户运行cmd:
输入: mysql -uroot -p #跳过了授权不用输入密码
输入: update mysql.user set password=password("123") where user="root" and host="localhost"; #修改密码
输入: flush privileges; #刷新授权表
输入: tasklist | findstr mysql #查看进程id
      以管理员的身份运行cmd:
输入:taskkill /F /PID  7464 #杀死进程
输入:net start mysql#启动M有SQL服务
输入:mysql -uroot -p123 # 用之前修改的密码

9.登陆用户的两种方式:

mysql -uroot -p123
    mysql -uroot -p123 -h 127.0.0.1 -P 3306  #默认端口是3306

10.设置默认编码
在mysql的文件目录i中创建my.ini文件添加
 #mysql5.5以上:修改方式有所改动
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324979135&siteId=291194637