In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The following is about the detailed steps of compiling, installing and configuring Mysql. The secret of the text is to be close to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading the detailed steps of compiling, installing and configuring Mysql.
1. Basic concepts of database:
(1) data
Symbolic records describing things are called: data data includes numbers, text, graphics, images, sounds, archival records, etc., and is stored in a unified format in the form of "records".
(2) Table:
Organize different records together to form a "table"; it is used to store specific data.
(3) Database:
A database is a collection of tables and a warehouse for storing databases; interrelated data stored in a certain organizational manner
2. Introduction of mainstream databases:
SQL Server (Microsoft products)
Simple and easy to use for Windows operating system
Oracle (Oracle products)
For all mainstream platforms, safe, perfect and complex to operate
DB2 (IBM products)
Large, secure and perfect for all mainstream platforms
MySQL (acquired by Oracle)
Free, open source, small size
III. Relational database (relational and non-relational):
(1) Relational database:
1. It is a database system based on relational model, and its basic concept comes from relational model.
2. the relational model is based on the theory of relational algebra, and the data structure uses a simple two-dimensional data table, which can be directly represented by a simple "entity-relation" (E-R) diagram.
3. The E-R diagram contains three elements: entities (data objects), relations and attributes.
For example, the following is the Emurr diagram between the bank customer and the bank
Entity: instance attribute: a characteristic that an entity has, a physical object can have multiple attributes; connection: the corresponding relationship between a set of entities becomes a relationship, also known as a set of relationships between all entities and the relationship between entities constitutes a relational database
4. The storage structure of the relational database is a two-dimensional table, and the data reflecting the object and its relationship is saved in the form of a table.
5. In each two-dimensional table, each row is called a record, which is used to describe the information of an object; each column is called a field, which is used to describe the properties of the object.
6. Relational database applications:
Relational database
Oracle, MySQLSQLServer 、 SybaseInformix 、 accessDB2 、 FoxPRO
Application examples of Relational Database
12306 user information system Taobao account information system, Alipay account system mobile, telecom, Unicom mobile phone number information system, billing system, bank account system, website user information system.
(2) non-relational database:
1. The non-relational database is not based on the relational model and does not need a fixed table format. As a supplement to the relational database, it has the following advantages:
The requirement of high concurrent read and write of database, the efficient storage and access of massive data, the high expansibility and high availability of database.
2. Storage method: key imitation (key-value)
Store, delete and modify data based on keys
3. Non-relational database products:
Memcached is an open source. High-tech, distributed memory object caching system, which stores data in key-value style, has the following characteristics:
Cache data to reduce database pressure and speed up access; accelerate dynamic Web applications; keep cached contents in memory
Redis is also typical of storing data in key-value style, which seems to have the following characteristics:
Support memory cache; support persistence; more data types; support clustering, distributed; support queues
(3) introduction to Mysql database:
Oracle products
Following the GPL agreement, you can try and modify it free of charge.
Features:
Superior performance, stable open source service, no version restriction, low cost multi-thread, multi-user client / server architecture secure and reliable.
4. Install Mysql:
Environmental preparation:
1. System: centos7
2. Version: mysq |-5.7.17
3. Prepare the software package:
(1) boost 159 _ 0.tar
(2) mysql-5.7.17.tar
Step 1: install the compilation tool
Yum-y install\ ncurses\ ncurses-devel\ bison\ cmake\ gcc\ gcc-c++
Step 2: create a user
Useradd-s / sbin/nologin mysql
Step 3: decompress the package
Tar zxvf mysql-5.7.17.tar.gz-C / opt/tar zxvf boost_1_59_0.tar.gz-C / usr/local/
Easy to operate, you can rename boost_1_59_0
Mv boost_1_59_0 boost
Step 4: cmake
Cd mysql-5.7.17/cmake\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock\-DSYSCONFDIR=/etc\-DSYSTEMD_PID_DIR=/usr/local/mysql\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_ARCHIVE_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITH_PERFSCHEMA_STORAGE_ENGINE=1\-DMYSQL_DATADIR=/usr/local/mysql / data\-DWITH_BOOST=/usr/local/boost\-DWITH_SYSTEMD=1
Step 5: compile and install
Make & & make install
Step 6: authorize and modify configuration files
(1) authorization
Chown-R mysql.mysql / usr/local/mysql/
(2) modify the configuration file
Vi / etc/my.cnf, delete the original content in the file Then add the following code: [client] port = 3306default-character-set=utf8socket = / usr/local/mysql/ mysql.socks [MySQL] port = 3306default-character-set=utf8socket = / usr/local/mysql/ mysql.socks [mysqld] user = mysqlbasedir = / usr/local/mysqldatadir = / usr/local/mysql/dataport = 3306character_set_server=utf8pid-file = / usr/local/mysql/mysqld.pidsocket = / usr/local/mysql/mysql.sockserver-id = 1sqlcards modeworthy NONGENGENGINESER NO_AUTO_VALUE_ON_ZERO,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,PIPES_AS_CONCAT,ANSI_QUOTES
Step 7: add permissions and modify environment variables
(1) add permissions
Chown mysql:mysql / etc/my.cnf
(2) modify environment variables
Echo 'PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH' > > / etc/profileecho' export PATH' > > / etc/profilesource / etc/profile / / to make the environment variable effective
Step 8: initialize the database
Cd / usr/local/mysql/bin/mysqld\-initialize-insecure\-user=mysql\-basedir=/usr/local/mysql\-datadir=/usr/local/mysql/data
Step 9: easy to manage and copy the mysql service to the system directory for easy operation
Cp / usr/local/mysql/usr/lib/systemd/system/mysqld.service / usr/lib/systemd/system/
Step 10: start the mysql service
(1)
Systemctl daemon-reloadsystemctl start mysqld / / enable mysqlnetstat-anpt | grep 3306 / / check whether mysql has been enabled
(2) password for creating mysql database:
Mysqladmin-u root-p password "abc123" / / set the password for the root account to abc123 prompt for the original password. Mysql-u root-p
(3) authorize remote login:
Grant all privileges on *. * to 'root'@'%' identified by' abc123' with grant option;// allows any remote terminal to log in
Is there anything you don't understand about the detailed steps of compiling, installing and configuring Mysql above? Or if you want to know more about it, you can continue to follow our industry information section.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.