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

How to view and modify the login name and password of mysql in Ubuntu

2025-04-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to view and change the login and password of mysql in Ubuntu? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

View and modify the user name and password of mysql

Step one:

At this point, you need to enter the / etc/mysql directory, and then sudo vim/vi debian.cnf to check the user name and password inside, and then use the user name and password in this file to enter mysql. If the user name in debian.cnf is debian-sys-maint, then:

Mysql-u debian-sys-maint-p press enter, which requires you to enter your password and copy the password in debian.cnf (do not enter it manually, because it is prone to errors).

At this point, you can enter mysql.

Step 2:

Modify the human root password

Log in to the mysql client according to the previous step

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

Step 3:

Log in with the newly changed root and password.

Install phpmyadmin

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

2. After the installation is complete, go to the apache server directory (changed from / var/www/html to / media/home/ivalley) and find that there is no phpmyadmin, such files or folders

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

4. Therefore, we must establish a soft connection so that the file shown in step 3 is linked to a document under / media/home/ivalley, enter the following code sudo ln-s / usr/share/phpmyadmin / media/home/ivalley/phpmyadmin

This is the answer to the question about how to view and modify the login name and password of mysql in Ubuntu. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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

Database

Wechat

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

12
Report