Ubuntu View and modify mysql login name and password, install phpmyadmin

Ubuntu View and modify mysql login name and password, install phpmyadmin

After installing MySQL, enter mysql -u root -p in the terminal and press Enter. After entering the password, it prompts access denied......ues password YES/NO error

The reason is that the username or password is incorrect!

View and modify mysql username and password

first step:

At this time, you need to enter the /etc/mysql directory, then sudo vim/vi debian. to view the username and password in it, and then use the username and password in this file to enter mysql. If the username in debian.cnf is debian-sys-maint, then:

mysql -u debian-sys-maint -p Press Enter. You will be asked to enter your password. Copy the password in debian.cnf (do not enter it manually as it is easy to make mistakes).

Now you can enter mysql

Step 2:

Modify root password

Log in to the MySQL client according to the previous step

mysql> use mysql;
Database changed
mysql> update user set password=password('new password') where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit

Step 3:

Log in with the newly changed root and password to view.

Install phpmyadmin

1. Open the terminal, enter sudo apt-get install phpmyadmin , and press Enter

2. Then, after the installation is complete, check the Apache server directory (which has been changed from /var/www/html to /media/home/ivalley) and find that there is no such file or folder as phpmyadmin.

3. Here is the key point. When the system installs the software, it is installed in /usr/share/ by default, so your phpmyadmin can be found in /usr/share

4. Therefore, we must create a soft link to sudo ln -s /usr/share/phpmyadmin /media/home/ivalley/phpmyadmin

5. Next, open the browser, enter http://localhost/phpmyadmin, enter your account name and password, and you can log in smoothly and use the MySQL database happily.

Summarize

The above is what I introduced to you about how to view and modify the login name and password of MySQL on Ubuntu and install phpmyadmin. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time!

You may also be interested in:
  • How to change the root user's password in MySQL
  • MySQL 8.0.19 winx64 installation tutorial and change the initial password under Windows 10
  • mysql8.0 forgotten password modification and net command service name invalid problem
  • 4 ways to modify MySQL root password (summary)
  • How to allow external network access to mysql and modify mysql account password
  • How to modify the root user password in mysql 8.0.16 winx64 and Linux
  • How to correctly modify the ROOT password in MySql8.0 and above versions
  • Problems with changing password and connecting to Navicat when installing and using MySQL 8.0.16 under Windows 7
  • Solve the problem of changing the password when logging in for the first time after installing MySQL 8.0
  • Summary of how to modify the root password in MySQL 5.7 and MySQL 8.0
  • Several ways to change MySQL password

<<:  Detailed explanation of the abbreviation of state in react

>>:  How to install Linux flash

Recommend

A screenshot demo based on canvas in html

Written at the beginning I remember seeing a shar...

Introduction to user management under Linux system

Table of contents 1. The significance of users an...

In-depth study of how to use positioning in CSS (summary)

Introduction to Positioning in CSS position attri...

Summary of important mysql log files

Author: Ding Yi Source: https://chengxuzhixin.com...

How to reduce the root directory of XFS partition format in Linux

Table of contents Preface System environment Curr...

Optimized record of using IN data volume in Mysql

The MySQL version number is 5.7.28. Table A has 3...

How to enable JMX monitoring through Tomcat

Build a simulation environment: Operating system:...

Node.js uses express-fileupload middleware to upload files

Table of contents Initialize the project Writing ...

Realize three-level linkage of year, month and day based on JavaScript

This article shares the specific code for JavaScr...

Installation tutorial of MySQL 5.1 and 5.7 under Linux

The operating system for the following content is...

How to use the EXPLAIN command in SQL

In daily work, we sometimes run slow queries to r...

Global call implementation of Vue2.x Picker on mobile terminal

Table of contents What is the Picker component Pr...