Database BASICS (1)-concept, MySQL installation and maintenance, database mysql
I. Basic concepts of databases
Database: data is stored together in a certain way, shared for multiple users, with the smallest possible redundancy, and a set of data independent from each other.
DBMS (DataBase Management System) and DataBase. When talking about "databases", there may be two meanings: MSSQLServer, Oracle, and other DBMS; a type that stores a bunch of data tables (Catalog ).
Common databases: MYSQL, MSSQLServer, DB2, Oracle, Access, Sybase, etc.
Currently, all databases are relational databases.
Relational databases usually contain the following components:
-- Client application)
-- Database Server)
-- Database)
--- DBA Database Administrator
--- Primary key)
A primary key is the unique identifier of a Data row. It cannot be null or repeated (whether the primary key can be null)
--- Table Association and foreign key (ForeignKey)
A column in the table is the primary key in another table. We call it a foreign key. For example, the student information table has a school ID, and the school ID is the primary key of the school table.
--- Others: data redundancy and data integrity, entity integrity, reference integrity, domain integrity and domain constraints, E/R diagram, paradigm
2. Comparison of various databases
-- Access
It is a desktop database that is suitable only for applications with a small amount of data. It is very efficient in processing a small amount of data and accessing a single database. However, it cannot access more than four clients at the same time. Microsoft Access database has a certain limit. If the data reaches about MB, it is easy to cause the server. The iis server is suspended, or the server memory is consumed, causing the server to crash. The English "Service Unavailable" is displayed ". Its database files can be migrated directly with the project.
-- Ms SQL Server
It is a medium-sized database based on the server, which can be suitable for applications with large data volumes and is more powerful than Microsoft Access in terms of function management. It is powerful in processing massive data efficiency, backend development flexibility, and scalability. Currently, all databases use standard SQL language for database management. Therefore, both of them can be used in a standard SQL language. Microsoft SQL Server also has more extensions, allowing you to use stored procedures. The database size is unlimited.
-- MySql
Is an open-source database server that can run on a variety of platforms, such as windows, unix/linux. its small size is designed for WEB databases and features extremely fast response speed, it is mainly intended for small and medium-sized enterprises and is insufficient for massive databases. It is a real multi-user multi-task database system. It occupies very few system resources but has powerful functions and can be used as a large database system, the most important thing is that its Standard Edition is free of charge. Yahoo uses mysql, which is mainly developed in combination with php. MySQL supports the network and community.
-- Oracle
All aspects are relatively mature, but they have high hardware requirements and are used for scenarios with high data integrity and security requirements. They can run on all mainstream platforms and fully support all industrial standards, adopt a fully open policy. This allows customers to select the most suitable solution and provide full support to developers. Parallel servers expand the capabilities of servers by allowing a group of nodes to share the work of the same cluster, provide high availability and high scalability cluster solutions, and obtain the highest level of iso certification, multi-layer network computing supports a variety of industrial standards. It can be connected to network customers such as odbc, jdbc, and oci. It is complex. It also provides gui and command lines, and the operations are the same in windows and unix, if windows cannot meet your needs, you can move the database to unix. Its operations and settings are complex and suitable for users with certain operation experience.
-- IBM DB2
DB2 is mainly used in large-scale application systems and has good scalability. It can be applied to all common server operating systems from the mainframe to the single-user environment. DB2 provides high-level data availability, integrity, security, recoverability, and execution capabilities for small-scale to large-scale applications. It has basic platform-independent functions and SQL commands.
Iii. MySQL Installation
1. Find the installation package
2. Double-click to install
3. select Custom (Custom) or complete
4. Install the SDK (you can execute it by default)
5. display the installation path (Click Install)
6. Waiting
7. Select "Skip" and click "Next ".
8. Click Finish.
9. Next
10. By default, click Next.
11. Default Value: Next (change the value here when only the server is required in the future)
12. By default, click Next.
13. Next
14. Next
15. Next
16. Pay attention to it here (first by default, you need to change it manually)
Or
17. Next
18. Enter root in Password. Set your own password
19. Execute
20. Waiting
21. OK
22. If yes, double-click it.
23. Enter the password and press Enter.
24. In the task manager, check whether there is a real startup
25. You can use DOS to enable or disable mysql.
Iii. MySQL Database Maintenance
Start mysql --> net start mysql ()
Stop mysql --> net stop mysql \()
Go to mysql ---> mysql-uroot-p directly under the command line
Iv. MySQL Database Password Modification
1) modify the configuration file my. ini and add skip-grant-tables to the last line.
2) restart the service // net stop mysql, and then net start mysql
3) log on to the command line C:> mysql-uroot-p
4) run the use mysql command line;
5) execute the statement update user set password = password ('new password') where user = 'root' // This user is a system table
6) restore the modified configuration file.
7) restart the service.
V. delete a MySQL database
1) uninstall
2) delete its installation directory // back up the database if necessary
3) delete all related items in the Registry
Start Registry: Run regedit in the command line.