当前位置:网站首页>Four ways to install MySQL in Linux
Four ways to install MySQL in Linux
2022-06-13 08:16:00 【BT youth】
Source code installation MySQL:
1. Install development tools and packages
yum install make gcc gcc-c++ cmake bison-devel ncurses-devel
yum install libaio libaio-devel openssl-devel
yum install perl-Data-Dumper
yum install net-tools
2. decompression
tar xvf mysql-boost-5.7.14.tar.gz -C /ruanjian/mysql
( First create mysql Folder )
3. Create users and groups
groupadd -r -g 306 mysql
useradd -g 306 -r -u 306 mysql
4.
cmake -DCMAKE_INSTALL_PREFIX=/ruanjian/mysql -DMYSQL_DATADIR=/ruanjian/mysql/data -DDEFAULT_CHARSET=utf8 DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=/ruanjian/mysql/mysql-7.5/boost/
( Configure in the unzipped package )
5. Compilation and installation
[[email protected] mysql-5.7.14]# make && make install
6. initialization
/ruanjian/mysql/bin/mysqld --initialize --user=mysql -datadir=/ruanjian/mysql/data --basedir=/ruanjian/mysql/
7. by mysql Provide the master configuration file
cd /usr/local/mysql/
\cp support-files/my-default.cnf /etc/my.cnf
vim /etc/my.cnf
Add the following line to specify mysql The location of the data file :
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
8. by mysql Provide sysv Service script
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
9. Configure environment variables
vim /etc/profile.d/mysql.sh
export PATH=$PATH:/usr/local/mysql/bin
source mysql.sh
10. start-up MySQL
11. Configure a password
Use security plug-ins : mysql_sevure_installation
Get into MySQL terminal : ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySQL';
If you make a mistake , The password is too short ,MySQL No authentication succeeded
Modify the authentication rules :
set global validate_password_policy=0;
set global validate_password_length=1;
Binary installation MySQL:
1. newly build MySQL Users and groups ( There is no need to create groups )
groupadd -r -g 306 mysql
useradd -g 306 -r -u 306 mysql
2. Unzip the file
3. install MySQL tar xvf mysql-5.7.14-linux-glibc2.5-x86_64.tar.gz
4. Create virtual connection ln -sv mysql-5.7.14-linux-glibc2.5-x86_64 mysql
5. change MySQL The group to which the belongs chown -R mysql.mysql mysql/*( You can leave it blank )
6. initialization mysql/bin/mysqld --initialize --user=mysql --basedir=/ruanjian/mysql -datadir=/ruanjian/mysql/data
7. Set up profiles and provide sysv Service script ( must CD To /ruanjian/mysql Catalog )
\cp support-files/my-default.cnf /etc/my.cnf
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
vim /etc/my.cnf
Add the following line to specify mysql The location of the data file :
basedir = /ruanjian/mysql
datadir = /ruanjian/mysql/data
port = 3306
notes : May come across mysql.sock Can't find , therefore Set up
socket=/var/lib/mysql/mysql.sock --- solve mysq.sock No problem found
skip-grant-tables -- Setting startup does not require a password
No need to enter the password mysql Modify the expired password permission later
update mysql.user set password_expired='N';
Then enter /etc/my.cnf Note out skip-grant-tables,
Enter with the initial password that will do Change Password
see mysqld Whether there is Execution Authority Add execute permission :chmod +x /etc/rc.d/init.d/mysqld
8. start-up MySQL
chkconfig --add mysqld -- Add as system service
chkconfig mysqld on -- Boot up ( Not set up )
systemctl start mysqld start-up MySQL
9. Configure environment variables
cd /etc/profile.d/ # vim mysql.sh
Add the following :export PATH=$PATH:/ruanjian/mysql/bin
source mysql.sh
10. Configure a password ( ditto )
Use security plug-ins : mysql_sevure_installation
Get into MySQL terminal : ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySQL';
If you make a mistake , The password is too short ,MySQL No authentication succeeded
Modify the authentication rules :
set global validate_password_policy=0;
set global validate_password_length=1;
yum install MySQL:
1. To configure yum Source
2. install MySQL yum install mysql-server mysql-client
If an error is reported : software package :akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda) need :mariadb-server Deleting : 1:mariadb-server-5.5.60-1.el7_5.x86_64 (@anaconda) mariadb-server = 1:5.5.60-1.el7_5 replace , from : mysql-community-server-5.6.44-2.el7.x86_64 (mysql56-community) Not found
You need to yum -y remove mariadb-libs To cancel mariadb Dependency of
3. start-up MySQL systemctl start mysqld
4. View random password grep 'temporary password' /var/log/mysqld.log
Or use a security plug-in : mysql_sevure_installation The first random password can be left blank , Press enter to change the password
5. The first time you log in, change your password
Get into MySQL terminal : ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySQL';
If you make a mistake , The password is too short ,MySQL No authentication succeeded
Modify the authentication rules :
set global validate_password_policy=0;
set global validate_password_length=1;
The location of the configuration file : /etc/mysql/mysql.conf.d/mysqld.cnf
rpm install MySQL:
1. Unzip the installation package tar xvf
2. Delete mariadb-libs
3. Installation depends on net-tools
4. install MySQL
rpm -ivh mysql-community-client-5.7.14-1.el7.x86_64.rpm
mysql-community-common-5.7.14-1.el7.x86_64.rpm
mysql-community-libs-5.7.141.el7.x86_64.rpm
mysql-community-server-5.7.14-1.el7.x86_64.rpm
5. start-up MySQL systemctl start mysqld
6. Configure a password ( ditto )
Use security plug-ins : mysql_sevure_installation
Get into MySQL terminal : ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySQL';
If you make a mistake , The password is too short ,MySQL No authentication succeeded
Modify the authentication rules :
set global validate_password_policy=0;
set global validate_password_length=1;
边栏推荐
- 【博弈论-完全信息静态博弈】 Nash均衡的应用
- v-for生成的子组件列表删除第n行出现数据错乱问题
- 23 | adventure and prediction (II): relay race in the assembly line
- ERP基础数据 华夏
- Determination of ranking
- Dfinity (ICP) basic development tutorial-5
- 将solidworks建的机器人模型导入到ros中
- Altium Designer中导入和导出设置的方法
- 3. deploy the fabric2.2 cluster (use the official demo)
- 2022年危险化学品经营单位安全管理人员特种作业证考试题库及模拟考试
猜你喜欢
![[game theory complete information static game] Nash equilibrium](/img/db/9923f5a7465c8b57182f09810b65bf.jpg)
[game theory complete information static game] Nash equilibrium
![[game theory complete information static game] Application of Nash equilibrium](/img/22/5fd28415cba6ee67878249b4aabb2e.jpg)
[game theory complete information static game] Application of Nash equilibrium

Word中批注的使用方法

Effective Go - The Go Programming Language

Data disorder occurs when the n-th row of the subcomponent list generated by V-for is deleted

口碑好的食材配送信息化管理系统怎么样?

21 | pipeline oriented instruction design (Part 2): How did Pentium 4 fail?

汽配行业面临的难题用什么软件帮忙解决呢

19 | establish data path (bottom): instruction + operation =cpu

OpenHarmony笔记-----------(一)
随机推荐
平面合并(MATLAB)
Detailed explanation of digital certificate and Ca
Do not update the sub component page of parameter object passed from parent to child of nailing applet?
23 | adventure and prediction (II): relay race in the assembly line
微服务系统架构搭建一:环境搭建
Unity exit Editor Mode
Examination question bank and simulation examination for special operation certificate of safety management personnel of hazardous chemical business units in 2022
4. fabric2.2 create and join channels (use the official demo)
汽配行业面临的难题用什么软件帮忙解决呢
How to download and install stm32cubemx
钉钉小程序如何隐藏tab
24 | adventure and prediction (III): thread pool in CPU
Effective Go - The Go Programming Language
[problem record] taberror: inconsistent use of tabs and spaces in indentation
Edge浏览器使用BdTab新标签页插件(BD新标签页)
Go interface implementation principle [advanced level]: type_ interface struct
Edge浏览器如何安装BdTab(BD)新标签页插件(图文教程)
Data disorder occurs when the n-th row of the subcomponent list generated by V-for is deleted
Idea shortcut summary
What software can be used to solve the problems faced by the auto parts industry