当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
let和const命令
字符串的扩展
win11中利用IIS10搭建asp网站
Volatility取证工具使用日记
Qt Creator + CMake 运行调试总会自动 build 所有目标
第7章 网络层第3次练习题答案(第三版)
uni-app进阶之内嵌应用【day14】
在kali上搭建vulhub漏洞靶场
Memcached :安装
Anaconda configure environment directives
什么是 GameFi?
小白学爬虫——爬虫入门
踏上编程之路,你必须要干的几件事
为什么redis是单线程还那么快?
leetcode-每日一题745. 前缀和后缀搜索(哈希和字典树)
数字取证autopsy工具用法
C language tutorial (2) - printf and data types that come with c
【JVM加载】---类加载机制
初涉C语言
Linux修改MySQL数据库密码







