当前位置:网站首页>Linux下mysql数据库安装教程
Linux下mysql数据库安装教程
2022-07-05 13:55:00 【全栈程序员站长】
1 . 安装新版mysql前,需将系统自带的mariadb-lib卸载 [[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 上传mysql :mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar 3 创建文件夹:mkdir /usr/local/mysql 3 解压安装包到目标文件夹下: tar -xvf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql
4 使用rpm -ivh命令依次进行安装,安装顺序rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm mysql-community-libs-5.7.18-1.el7.x86_64.rpm(依赖于common) mysql-community-client-5.7.18-1.el7.x86_64.rpm(依赖于libs) mysql-community-server-5.7.18-1.el7.x86_64.rpm(依赖于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 这里说的很清楚,缺少perl,执行yum install perl然后在安装,成功! 5 启动及停止MySQL 完成安装步骤之后,首先配置MySQL的开机自动启动,在这里使用systemctl命令。 # systemctl enable mysqld.service 接着使用systemctl start mysqld.service命令启动MySQL。 # systemctl start mysqld.service 而停止MySQL时使用systemctl stop mysqld.service命令。 # systemctl stop mysqld.service 6 登陆MySQL 这时候又会碰到困难,没有密码进不去: 在/ect/my.cnf 的最后面加上一行: skip-grant-tables 保存退出 重启mysql服务:service mysqld restart 然后再连接mysql就可以了 进入mysql: use mysql; update mysql.user set authentication_string=password(‘123qwe’) where user=’root’; 然后再把my.cnf里面加的那行删掉,然后再用root账号和密码进入mysql 进去之后需要重新设置root密码: SET PASSWORD = PASSWORD(‘[email protected]’); ALTER USER ‘root’@’localhost’ PASSWORD EXPIRE NEVER;//设置密码永不过期 这个密码必须符合密码规范 flush privileges;(使立即生效) 设置远程可以登录: GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘[email protected]’ WITH GRANT OPTION; flush privileges;(使立即生效) 7 设置防火墙: 开启端口 firewall-cmd –zone=public –add-port=3306/tcp –permanent 重启防火墙 firewall-cmd –reload 查看规则是否生效 iptables -L -n
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/111284.html原文链接:https://javaforall.cn
边栏推荐
- What about data leakage? " Watson k'7 moves to eliminate security threats
- Basic characteristics and isolation level of transactions
- Network security HSRP protocol
- Can graduate students not learn English? As long as the score of postgraduate entrance examination English or CET-6 is high!
- 2022 driller (drilling) examination question bank and simulation examination
- -Web direction attack and defense world
- 【华南理工大学】考研初试复试资料分享
- laravel-dompdf导出pdf,中文乱码问题解决
- Jasypt configuration file encryption | quick start | actual combat
- Blue Bridge Cup study 2022.7.5 (morning)
猜你喜欢
基于微信小程序的订餐系统
我为什么支持 BAT 拆掉「AI 研究院」
深拷贝真难
【云资源】云资源安全管理用什么软件好?为什么?
[server data recovery] a case of RAID5 data recovery stored in a brand of server
When using Tencent cloud for the first time, you can only use webshell connection instead of SSH connection.
Wonderful express | Tencent cloud database June issue
那些考研后才知道的事
Kotlin collaboration uses coroutinecontext to implement the retry logic after a network request fails
Aikesheng sqle audit tool successfully completed the evaluation of "SQL quality management platform grading ability" of the Academy of communications and communications
随机推荐
UE源码阅读[1]---由问题入手UE中的延迟渲染
鏈錶(簡單)
Can graduate students not learn English? As long as the score of postgraduate entrance examination English or CET-6 is high!
Set up a website with a sense of ceremony, and post it to the public 2/2 through the intranet
Rk3566 add LED
Those things I didn't know until I took the postgraduate entrance examination
Jetpack compose introduction to mastery
那些考研后才知道的事
常见问题之PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...
[South China University of technology] information sharing of postgraduate entrance examination and re examination
Recommendation number | what are interesting people looking at?
Elk enterprise log analysis system
Laravel framework operation error: no application encryption key has been specified
Some ideas about Apache mesos
Require, require in PHP_ once、include、include_ Detailed explanation of the efficiency of repeated introduction of once class library
Wechat app payment callback processing method PHP logging method, notes. 2020/5/26
蓝桥杯学习2022.7.5(上午)
Kotlin协程利用CoroutineContext实现网络请求失败后重试逻辑
[machine learning notes] how to solve over fitting and under fitting
UE source code reading [1]--- starting with problems delayed rendering in UE