当前位置:网站首页>[MySQL 05] SUSE 12 SP5 modifies the MySQL password for the first time after installing MySQL
[MySQL 05] SUSE 12 SP5 modifies the MySQL password for the first time after installing MySQL
2022-06-30 01:57:00 【Rusty well began】
1、 View installed MySQL edition :
command :mysql --version

2、 start-up MySQL service
start-up MySQL service :systemctl start mysql.service
restart MySQL service :systemctl restart mysql.service
close MySQL service :systemctl stop mysql.service

3、 Check MySQL Whether the service starts
Method 1:systemctl list-unit-files|grep mysqld.service

Method 2 :systemctl status mysql.service

4、 Set the password
4.1 View random password
rpm install MySQL Will automatically generate a random password , Can be found in /var/log/mysqld.log Find the password in this file
command :cat /var/log/mysql/mysqld.log |grep temp
Tips: If you are unsure of the path , have access to find Command find mysqld.log file

4.2 Log in with random password
command :mysql -uroot -ppCg3+El.c#ao

4.3 modify root User password
command :ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ' password ‘;

Here may be a hint Your password does not satisfy the current policy requirements, Your password does not meet the requirements of the current regulations , You can either make your password a little more complicated , Or lower the password verification rules .
stay Linux Installation on MySQL A plug-in for verifying passwords will be installed automatically , The default password checking policy requires that the password must contain : Case letters 、 Numbers and special symbols , And the length cannot be less than 8 position . Whether the new password conforms to the current policy when changing the password , If you are not satisfied, you will be prompted ERROR;
The password verification rules can be found on the official website , Search in documents :validate_password;

So you can set this limit to a smaller number of digits , Lower the complexity type
# Adjust password complexity check to simple type
set global validate_password.policy = 0;
# Set the minimum number of digits of password to 9 position
set global validate_password.length = 9;


You can set a simpler password .

5、 Create user and permission assignment
<1> default root Users can only the current node localhost visit , Is not remotely accessible , We also need to create a new account , For remote access
Grammar format :CREATE USER < user name > [ IDENTIFIED ] BY [ PASSWORD ] < password >
# mysql 8.0 following
create user 'siteweb'@'%' IDENTIFIED BY 'siteweb1!';
# mysql 8.0
create user 'siteweb'@'%' IDENTIFIED WITH mysql_native_password BY 'siteweb1!';
Tips: mysql8.0 The default password authentication for is no longer password . So when you create a user ,create user ‘username’@‘%’ identified by ‘password’; The client cannot connect to the service , So when creating users, you need to add WITH mysql_native_password

<2> After you create a user, you need to assign permissions to the user , I will be here siteweb This user is assigned all permissions
grant all privileges on *.* to 'siteweb'@'%';
flush privileges; # Refresh the permissions


边栏推荐
- OpenCV和Image之间的转换(亲测有效)
- MySQL monitoring 6
- 工具与生活服务
- C语言 我要通过
- C language irony
- Local page floating animation is realized with the help of scroll wheel
- Varnish foundation overview 10
- The (3n+1) conjecture that C language kills people without paying for their lives
- C language I want to pass
- Difference between test plan and test plan
猜你喜欢

C language score ranking
![[graph neural network] summary of graph classification study [3]: evaluation of graph classification methods and future research directions](/img/b1/2afa73a14b2f41b7a65c4c2d261e6a.png)
[graph neural network] summary of graph classification study [3]: evaluation of graph classification methods and future research directions

想转行,但不知道自己要做什么工作比较好?

C language continues (3n+1) conjecture

Unity2d-- add keys to animation and bind events

DMX的配置

【MySQL 06】linux + Docker容器环境中备份和还原MySQL数据库

C语言 写出这个数

C language irony

C语言 数素数
随机推荐
[MySQL 04] use MySQL workbench 8.0 CE to back up and restore MySQL databases in Linux
What should be paid attention to in the design and production of the Urban Planning Museum
Sorting out the usage of transforms in pytoch
C language output integer in another format
Leetcode 46 Full arrangement (February 15, 2022)
Scala基础【入门及安装】
C language irony
007_ checkbox
Varnish foundation overview 1
GeoTools WKT坐标系转换
工具与生活服务
cookie加密8
What are the payment and distribution systems?
MySQL monitoring
Write this number in C
Local page floating animation is realized with the help of scroll wheel
018_ rate
What to remember about the penalty for deduction of points in Item 1
假离婚变成真离婚,财产怎么办
Is the processor the main factor in buying a mobile phone?