当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
leetcode-2321. 拼接数组的最大分数(差分+枚举)
07 【内置指令 自定义指令】
Error: Cannot find module ‘D:\Application\nodejs\node_modules\npm\bin\npm-cli.js‘
11 【组件通信】
gin框架学习-Casbin进阶之策略管理API使用方法
leetcode-每日一题1252. 奇数值单元格的数目(模拟优化)
The process and specific code of sending SMS verification code using flask framework
let和const命令
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
闭包(三)----执行环境
vulhub靶场学习日记hackme2
If the account number or password is entered incorrectly for many times, the account will be banned.
【云原生】原来2020.0.X版本开始的OpenFeign底层不再使用Ribbon了
代码执行漏洞
Why is the redis single-threaded also so fast?
leetcode-每日一题731. 我的日程安排表 II
数据库上机实验2 单表查询和嵌套查询
12 【网页布局总结 元素的显示与隐藏】
C语言实验四 循环结构程序设计(一)
npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案