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

Example code for realizing charging effect of B station with css+svg

difficulty Two mask creation of svg graphics Firs...

Brief introduction and usage of Table and div

Web front end 1 Student ID Name gender age 01 Zha...

Alibaba Cloud Server Tomcat cannot be accessed

Table of contents 1. Introduction 2. Solution 2.1...

JavaScript function encapsulates random color verification code (complete code)

An n-digit verification code consisting of number...

Solution to "Specialized key was too long" in MySQL

Table of contents Solution 1 Solution 2 When crea...

Detailed usage of js array forEach instance

1. forEach() is similar to map(). It also applies...

Docker online and offline installation and common command operations

1. Test environment name Version centos 7.6 docke...

Sharing of experience on repairing MySQL innodb exceptions

A set of MySQL libraries for testing. The previou...

js to realize a simple advertising window

This article shares the specific code of js to im...

Detailed Tutorial on Using xargs Command on Linux

Hello everyone, I am Liang Xu. When using Linux, ...

Analysis of rel attribute in HTML

.y { background: url(//img.jbzj.com/images/o_y.pn...

Detailed explanation of how to configure Nginx web server sample code

Overview Today we will mainly share how to config...