search
HomeDatabaseMysql TutorialDetailed step-by-step introduction to changing the password of mysql database

This article brings you the detailed steps on changing the password of the MySQL database. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Recently I was looking at database-related things. After reinstalling the computer, the previous configuration was gone. In order to facilitate the direct configuration of the XAMPP one-click installation package, I encountered the following small problems during the configuration process. . Although the problem is not big, I still want to record it so that I don’t know how to deal with the same problem in the future.

1. Apache shutdown unexpectedly startup error
The error displayed when xampp starts is:
9:52:41 [Apache] Attempting to start Apache app...
9:52:41 [Apache] Status change detected: running
9:52:42 [Apache] Status change detected: stopped
9:52:42 [Apache] Error: Apache shutdown unexpectedly.
9:52:42 [Apache] This may be due to a blocked port, missing dependencies,
9:52:42 [Apache] improper privileges, a crash, or a shutdown by another method.
9: 52:42 [Apache] Check the "/xampp/apache/logs/error.log" file
9:52:42 [Apache] and the Windows Event Viewer for more clues

This is more common The problem of ports 80 and 443 being occupied is as follows:
(1) Port 443 is occupied:
Configure in /xampp/apache/conf/extra/httpd-ssl.conf Change listen 443 to 444 in the file (this port can be defined by yourself)
(2) Port 80 is occupied, apache cannot listen to port 80
In /xampp/apache/conf/extra/ httpd.conf Change Listen 80 to 88 (customizable); if vhosts is configured, please change the port in httpd-vhosts.conf to 88 (the same port number as above)
Link description

2. phpmyadmin access denied
The error when phpmyadmin access is denied is:
phpMyAdmin tried to connect to the MySQL server, but the server refused the connection. You should check the host, username, and password in the configuration file and confirm that the information matches the information given by the MySQL server administrator.
Cause of the error:
The root password in mysql.user was modified, which resulted in inconsistency with the password in the phpMyAdmin configuration file, so the connection could not be made.
Solution:
Modify $$cfg['Servers'][$i]['password']='yourpassword'; // set above for root in ../phpMyAdmin/config.inc.php Password

3. Mysql changes the initial password
(1) Win R and enter cmd to enter the cmd command prompt, enter mysql -uroot -p

Detailed step-by-step introduction to changing the password of mysql database

(2) If "mysql is not an internal or external command, nor an operable program or batch file" appears at this time, it means that the mysql configuration path is not placed under the environment variable. You need to put the path containing the mysql.exe and mysqld.exe files under the system environment variable;

(3) Enter the database password. If the login is successful, the following display will appear:

Detailed step-by-step introduction to changing the password of mysql database

(4) After successful login, enter show databases; you can see all databases

Detailed step-by-step introduction to changing the password of mysql database

(5) Enter use mysql; select the mysql database, which is where the user name is saved

Detailed step-by-step introduction to changing the password of mysql database

(6) show tables to view all tables, you will find that there are A user table, which stores account information such as user names, passwords, permissions, etc.

Detailed step-by-step introduction to changing the password of mysql database

(7) Enter select user,host,password from user; to view account information.

Detailed step-by-step introduction to changing the password of mysql database

(8) To change the root password, enter update user set password=password('123456') where user='root' and host=' localhost';

Detailed step-by-step introduction to changing the password of mysql database

(9) Check the account information again, select user,host,password from user; You can see that the password has been modified.

Detailed step-by-step introduction to changing the password of mysql database

(10) Exit the command line, restart the mysql database, and try to log in with a new password.

This completes the modification of the mysql database. The above are some minor problems encountered when configuring mysql. I will record them here.

This article ends here. For more knowledge about MySQL, you can pay attention to the MySQL Tutorial column on the php Chinese website! ! !

The above is the detailed content of Detailed step-by-step introduction to changing the password of mysql database. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:segmentfault. If there is any infringement, please contact admin@php.cn delete
图文详解mysql架构原理图文详解mysql架构原理May 17, 2022 pm 05:54 PM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于架构原理的相关内容,MySQL Server架构自顶向下大致可以分网络连接层、服务层、存储引擎层和系统文件层,下面一起来看一下,希望对大家有帮助。

mysql怎么替换换行符mysql怎么替换换行符Apr 18, 2022 pm 03:14 PM

在mysql中,可以利用char()和REPLACE()函数来替换换行符;REPLACE()函数可以用新字符串替换列中的换行符,而换行符可使用“char(13)”来表示,语法为“replace(字段名,char(13),'新字符串') ”。

mysql怎么去掉第一个字符mysql怎么去掉第一个字符May 19, 2022 am 10:21 AM

方法:1、利用right函数,语法为“update 表名 set 指定字段 = right(指定字段, length(指定字段)-1)...”;2、利用substring函数,语法为“select substring(指定字段,2)..”。

mysql的msi与zip版本有什么区别mysql的msi与zip版本有什么区别May 16, 2022 pm 04:33 PM

mysql的msi与zip版本的区别:1、zip包含的安装程序是一种主动安装,而msi包含的是被installer所用的安装文件以提交请求的方式安装;2、zip是一种数据压缩和文档存储的文件格式,msi是微软格式的安装包。

mysql怎么将varchar转换为int类型mysql怎么将varchar转换为int类型May 12, 2022 pm 04:51 PM

转换方法:1、利用cast函数,语法“select * from 表名 order by cast(字段名 as SIGNED)”;2、利用“select * from 表名 order by CONVERT(字段名,SIGNED)”语句。

MySQL复制技术之异步复制和半同步复制MySQL复制技术之异步复制和半同步复制Apr 25, 2022 pm 07:21 PM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于MySQL复制技术的相关问题,包括了异步复制、半同步复制等等内容,下面一起来看一下,希望对大家有帮助。

带你把MySQL索引吃透了带你把MySQL索引吃透了Apr 22, 2022 am 11:48 AM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了mysql高级篇的一些问题,包括了索引是什么、索引底层实现等等问题,下面一起来看一下,希望对大家有帮助。

mysql怎么判断是否是数字类型mysql怎么判断是否是数字类型May 16, 2022 am 10:09 AM

在mysql中,可以利用REGEXP运算符判断数据是否是数字类型,语法为“String REGEXP '[^0-9.]'”;该运算符是正则表达式的缩写,若数据字符中含有数字时,返回的结果是true,反之返回的结果是false。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)