Method 1: Use the SET PASSWORD command MySQL -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass'); Method 2: Using mysqladmin mysqladmin -u root password "newpass" If the root password has been set, use the following method mysqladmin -u root password oldpass "newpass" Method 3: Use UPDATE to edit the user table directly mysql -u root mysql> use mysql; mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root'; mysql> FLUSH PRIVILEGES; When you lose your root password, you can mysqld_safe --skip-grant-tables& mysql -u root mysql mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root'; mysql> FLUSH PRIVILEGES; The above is a detailed tutorial on setting passwords for the MySQL free installation version introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time! You may also be interested in:
|
<<: Methods for optimizing Oracle database with large memory pages in Linux
>>: Canvas draws scratch card effect
1. Inline styles To add inline styles to the virt...
Conversion between rgba and filter values under...
Table of contents 1. Introduction to NFS 2. NFS C...
Perhaps when I name this article like this, someon...
String extraction without delimiters Question Req...
Table of contents 1. Dep 2. Understand obverser 3...
The blogger hasn't used MySQL for a month or ...
This article example shares the specific code for...
Generally, lists have selection functions, and si...
Copy code The code is as follows: html { overflow...
1. Tools directory file structure [root@www tools...
Vertical table Vertical table splitting means spl...
Table of contents 1. Basic grammar 2. Filter by c...
The growth path from a Linux novice to a Linux ma...
1. Grid layout (grid): It divides the web page in...