[email protected] ~ / rpm qa grep mariadb mariadb libs 5.5.52 1.el7.x86 64...">

当前位置:网站首页>Mysql database installation tutorial under Linux

Mysql database installation tutorial under Linux

2022-07-05 14:11:00 Full stack programmer webmaster

1 . Install new version mysql front , The system's own mariadb-lib uninstall [[email protected] ~]# rpm -qa|grep mariadb mariadb-libs-5.5.52-1.el7.x86_64 [[email protected] ~]# rpm -e –nodeps mariadb-libs-5.5.52-1.el7.x86_64 2 Upload mysql :mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar 3 Create folder :mkdir /usr/local/mysql 3 Unzip the installation package to the target folder : tar -xvf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql

4 Use rpm -ivh Command to install in sequence , Installation sequence rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm mysql-community-libs-5.7.18-1.el7.x86_64.rpm( Depend on common) mysql-community-client-5.7.18-1.el7.x86_64.rpm( Depend on libs) mysql-community-server-5.7.18-1.el7.x86_64.rpm( Depend on common,client)

perl(Getopt::Long) is needed by mysql-community-server-5.7.18-1.el7.x86_64 perl(strict) is needed by mysql-community-server-5.7.18-1.el7.x86_64 It's very clear here , The lack of perl, perform yum install perl Then install , success ! 5 Start and stop MySQL After completing the installation steps , First configuration MySQL It starts automatically , Use it here systemctl command . # systemctl enable mysqld.service Then use systemctl start mysqld.service Command to start MySQL. # systemctl start mysqld.service And stop MySQL When using systemctl stop mysqld.service command . # systemctl stop mysqld.service 6 land MySQL At this time, we will encounter difficulties , You can't get in without a password : stay /ect/my.cnf Add a line on the last side of : skip-grant-tables Save and exit restart mysql service :service mysqld restart And then connect mysql That's all right. Get into mysql: use mysql; update mysql.user set authentication_string=password(‘123qwe’) where user=’root’; Then take it. my.cnf Delete the added line , And then use root Account and password entry mysql It needs to be reset after entering root password : SET PASSWORD = PASSWORD(‘[email protected]’); ALTER USER ‘root’@’localhost’ PASSWORD EXPIRE NEVER;// Set password never expires This password must conform to the password specification flush privileges;( To give immediate effect to ) Set up remote login : GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘[email protected]’ WITH GRANT OPTION; flush privileges;( To give immediate effect to ) 7 Set up firewall : Open port firewall-cmd –zone=public –add-port=3306/tcp –permanent service iptables restart firewall-cmd –reload See if the rule is in effect iptables -L -n

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/111284.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207051353305136.html

随机推荐