当前位置:网站首页>mysql password modification method in Linux (pro-test available)
mysql password modification method in Linux (pro-test available)
2022-07-31 05:47:00 【m0_67401499】
Prerequisite: install mysql
Extract mysql.tar.gz to the specified directory
Enter mysql-5.7.18 directory
Create folder mkdir data
Create a user to execute mysqld commands
groupadd mysql #Create a group mysql
useradd -g mysql mysql #Create a user and specify a groupInitialize the database, in the bin directory
./mysqld --initialize --user=mysql --datadir=/opt/mysql-5.7.18/data --basedir=/opt/mysql-5.7.18
Change mysql password
1. First start mysql
Start the MySQL service, execute the command in the mysql-5.7.18/bin directory: ./mysqld_safe &
(where the & symbol indicates background startup)
2. Log in to mysql
Log in to mysql, execute the command in the mysql-5.7.18/bin directory: ./mysql -u root -p
Enter the original password to enter
3. Set password
- set password=password('123456');
- Here '123456' is the new password set
- The input command in mysql must end with ;
Authorize remote access
Execute the authorization command: grant all privileges on . to [email protected]'%' identified by '123456';
Update the permission information, execute flush to refresh the permissions: flush privileges;
CloseFirewall: systemctl stop firewalld
View firewall status: systemctl status firewalld
Remote connection database access
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
猜你喜欢
第7章 网络层第2次练习题答案(第三版)
阿里一面,说说你知道消息中间件的应用场景有哪些?
第7章 网络层第3次练习题答案(第三版)
leetcode-每日一题735. 行星碰撞(栈模拟)
(Crypto essential dry goods) Detailed analysis of the current NFT trading markets
Sword Point Offer Special Assault Edition ---- Day 2
Redis管道技术/分区
MySQL-如何分库分表?一看就懂
GUCCI, LV and other luxury giant universe how to layout yuan, other brands should keep up with?
(Crypto必备干货)详细分析目前NFT的几大交易市场
随机推荐
局部变量成员变量、引用类型、this,static(第五天)
wpf wrapPanel居中并从左到右排列
win11中利用IIS10搭建asp网站
C language tutorial (2) - printf and data types that come with c
05 【绑定样式 条件渲染 列表渲染】
可以“繁殖”的程序
【swagger关闭】生产环境关闭swagger方法
02 【el和data的两种写法 MVVM模型】
【uiautomation】微信好友列表获取(存储到txt中)
C语言实验一 熟悉C程序的环境
vulhub靶场学习日记SickOs1.2
数据库上机实验2 单表查询和嵌套查询
Redis first meeting
Xiaobai learns reptiles - introduction to reptiles
uni-app进阶之样式框架/生产环境【day10】
NFT与数字藏品到底有何区别?
SQL注入中数据库的判断
Qt Creator + CMake 运行调试总会自动 build 所有目标
gin框架学习-Casbin进阶之策略管理API使用方法
Memcached :安装