当前位置:网站首页>Lamp architecture 4 -- MySQL source code compilation and use
Lamp architecture 4 -- MySQL source code compilation and use
2022-06-21 13:38:00 【Zhaohui_ Zhang】
Catalog
One 、MYSQL Source code compilation
2、MySQL Compilation of / install
One 、MYSQL Source code compilation
1、Mysql The download
MySQL Official website :
MySQL :: Download MySQL Community Server (Archived Versions)https://downloads.mysql.com/archives/community/

2、MySQL Compilation of / install
(1) Get compilation package , And extract the

(2) Install compiler
MySQL The compiler used is <cmake>. Simultaneous need <gcc> and <gcc-c++> Two compilation packages .

(3)cmake
The following is the official website document of source code compilation , This page has cmake Detailed introduction of various parameters of .

First step : After adding parameters ,cmake Verify dependencies
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DSYSCONFDIR=/etc -DWITH_EXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=/mnt/mysql-5.7.31/boost/boost_1_59_0Pay particular attention here to the path of the last item .

Find a warning , You don't have to deal with it , Only when an error occurs must it be handled .

Be careful :cmake When checking dependencies , The previous error messages will be stored in the cache file marked in the figure below , So the second verification is much faster than the first . If there is any change or warning, repair it , Be sure to delete this cache file ,cmake The dependency will be revalidated from the beginning .

The second step :make
make Then it will start compiling , The compilation speed depends on the computer configuration . It's slow , It's going to take a long time .

The compilation cost is about 40 minute , After compilation , Check the computer idle memory by the previous 15G Turn into 9.6G.

The third step :make install
Installed to the </usr/local/mysql> Under the table of contents

3、 To configure MySQL
(1) establish mysql Users and groups

(2) establish mysql Execute command script

(3) Create a data directory and set permissions
Here, set everyone and all groups in the data directory to mysql, And set its permissions to 750( Here is 755, No effect )

(4) change /etc Next mysql Configuration file for
This </etc/my.cnf> The main changes in the file corresponding to mysql The path to the data directory . Consistent with compile time .

(5) Add... To the environment variable of the system mysql Of bin route , and <source> Order it to take effect immediately .

(6)mysql initialization , Using the user “mysql” The user attribute of the
mysqld --initialize --user=mysqlOnce the initialization is complete , A temporary password will be generated ( The end shows )

(7) start-up mysql database

(8) Sign in mysql
mysql -pFirst login mysql You need to enter the initialization password , What was generated in the previous step is . But after logging in with this temporary password, nothing can be done .

(9) change mysql Initialization password of
mysql_secure_installationWhen initializing the password , You need to enter the default temporary password first , Then enter your own password . Follow each step , The operator chooses yes or no

(10) Log back in mysql database
Be careful : If you log in with a clear text password , There will be a warning ; So they are generally not <-p> Add clear text password after the parameter

4、 First use of database
stay nginx Under the release directory of phpMyadmin Test files for , And create a soft connection .

Preparation for testing :
First of all, open server1 Of php, Otherwise, the above suoyouphp Files will be inaccessible

And then change nginx Configuration of , To support php Webpage . Reload when changes are complete nginx Set up .

test :
Browser access <172.25.254.1/myadmin>, Access the web page management interface of the database .

Sign in mysql database :
Direct access times error , It is said that the specified file cannot be connected / Catalog . This is because server1 Of php Unable to read from the service mysql Data directory for .

troubleshooting : stay php Added to the configuration of mysql Data directory for .
change </usr/local/php/etc/php.ini> The following two positions in , add mysql Database directory of . Reload when changes are complete php Service configuration <systemctl reload php-fpm>


To test :
After logging in , Enter into mysql Database management page .

Summary of this chapter :
1、MySQL Official documents
MySQL :: MySQL 5.7 Reference Manual :: 2.9 Installing MySQL from Sourcehttps://dev.mysql.com/doc/refman/5.7/en/source-installation.html2、mysql Parameter help :

3、mysql The master and slave of the server ID Must be different ,ID by 0 Indicates that no host replication is allowed .
4、mysql Database refresh command
flush privileges; # Refresh database 边栏推荐
- What is Devops in an article?
- 修修补补一时爽,果断重构有担当——聊聊CRM分布式缓存优化
- Test the interface between app and wechat applet
- 服务治理的工作内容
- [in depth understanding of tcapulusdb technology] tcapulusdb construction data
- 6. functions
- 还在用generator生成xxx管理系统的CRUD代码?来看看我是怎么写的
- JS 中的集合引用类型
- Open source FTP server FileZilla server
- [untitled]
猜你喜欢

MySQL - table constraints

Kubernets Rapid Practical fighting and Core Principle Analysis

map. Values() to copy list and ArrayList

Unbounded territory won the title of innovative brand of digital culture industry in 2022

Kubernetes快速實戰與核心原理剖析
![[in depth understanding of tcapulusdb technology] tcapulusdb business data backup](/img/74/dcb7cfefd258fa17573c96a6e78323.png)
[in depth understanding of tcapulusdb technology] tcapulusdb business data backup

Flink CDC MongoDB Connector 的实现原理和使用实践

Hands on data analysis unit 2 section 4 data visualization

Summary of the latest remote deployment O & M tools

Eureka的TimedSupervisorTask类(自动调节间隔的周期性任务)
随机推荐
Numpy | insert variable length character array test OK
MySQL - table constraints
Matplotlib drawing tips
[in depth understanding of tcapulusdb technology] tcapulusdb business data backup
Setting of Seaborn drawing style
Kubernetes' fast practice and core principle analysis
分布式事务,原理简单,写起来全是坑
Tami dog sharing: the way of property right transaction and the significance of data-based property right transaction market
Is the live interactive function of the applet running in the app?
基于STM32电压检测和电流检测
Nouveau partage de l'expérience de travail à domicile
Leetcode height checker
Heat mapping using Seaborn
这不会又是一个Go的BUG吧?
curl常用参数详解及示例
【深入理解TcaplusDB技术】TcaplusDB业务数据备份
Nanjing University static program analyses -- Introduction learning notes
3. operator
百问百答第43期:应用性能探针监测原理-PHP探针
启牛商学院app下载证券开户,是安全的吗?有风险嘛?