当前位置:网站首页>[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


边栏推荐
猜你喜欢
![[protection mode] segment descriptor](/img/23/19b12c496da437fbf03829b7b4e3b8.jpg)
[protection mode] segment descriptor

Circular right shift of array elements in C language
![[graph neural network] overview of graph classification learning [2]: graph classification based on graph neural network](/img/5f/b23b64eed7f28ffd92c122b6859e2d.png)
[graph neural network] overview of graph classification learning [2]: graph classification based on graph neural network

Gesture digital enlightenment learning machine

Write this number in C

C语言 一元多项式求导

Cookie encryption 15 login encryption
![[mrctf2020]ezpop-1 | PHP serialization](/img/65/9b7a3ae3552d8784b0c77a1130d762.png)
[mrctf2020]ezpop-1 | PHP serialization

002_ container

C语言 写出这个数
随机推荐
007_ checkbox
Cookie encryption 11
Comprendre le principe AQS (organigramme et schéma de file d'attente synchrone)
210. Schedule II - depth traversal
Local page floating animation is realized with the help of scroll wheel
C language continues (3n+1) conjecture
Cookie encryption 12
018_ rate
Pytoch modifies the hook source code to obtain per layer output parameters (with layer name)
C language number prime
The first technology podcast month will begin soon
[protection mode] segment descriptor
Cookie encryption 15 login encryption
[MySQL 04] use MySQL workbench 8.0 CE to back up and restore MySQL databases in Linux
DTW学习(dynamic time warping)——思想、代码实现
假離婚變成真離婚,財產怎麼辦
CheapSwap 协议的诞生
Yyds dry inventory consistent and smooth zoom type and spacing
JS returned content is encoded by Unicode
Summary of DOM