Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the mysql database forgot its password?

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "what to do if the mysql database forgets its password". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First acquaintance with SQL

SQL (Structured Query Language is structured query language)

SQL language is mainly used to access data, query data, update data and manage relational database systems. SQL language is developed by IBM. There are three types of SQL languages:

DDL statement database definition language: database, table, view, index, stored procedure, such as CREATE DROP ALTER

DML statement database manipulation language: insert data INSERT, delete data DELETE, update data UPDATE, query data SELECT

DCL statement database control language: for example, control user's access rights GRANT, REVOKE

II. System database

Information_schema: mainly stores the information of some database objects in the system, such as user table information, column information, permission information, character information and so on.

Performance_schema: mainly stores performance parameters of the database server.

Mysql: authorization library, which mainly stores the permission information of system users. This library needs to be reinitialized if it is lost! But all previous authorization information is lost!

Test: a test database created automatically by the MySQL database system. For a secure database, this library should be deleted because it is a shared library!

Forget the MySQL password

# vim / etc/my.cnf

[mysqld]

Skip-grant-table

# service mysqld restart

# mysql

Mysql > select user,password,host from mysql.user

+-+

| | user | password | host | |

+-+

| | root | * F861720E101148897B0F5239DB926E756B1C28B3 | localhost | |

| | root | | sxl.com |

| | root | | 127.0.0.1 | |

| | root | |:: 1 |

| | localhost |

| | sxl.com |

+-+

6 rows in set (0.00 sec)

Mysql > update mysql.user set password=password ("456") where

User= "root" and host= "localhost"

Mysql > flush privileges

Mysql >\ Q

Fourth, create a database

Grammar

CREATE DATABASE database name

Database naming rules:

Can be composed of letters, numbers, underscores, @, #, $

Case sensitive

Uniqueness

Cannot use keywords such as create select

You cannot use numbers alone.

Up to 128 bits

Database related operations

View the database

SHOW DATABASES

SELECT database ();-> View the database currently in operation

Select database: USE database name

Delete database: DORP DATABASE database name

This is the end of the content of "what to do if you forget your password in mysql database". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report