What should I do if I forget mysql default password under centos?
Solution: 1. Use the "grep 'temporary password' /var/log/mysqld.log" command to retrieve the initial password during installation; 2. Modify the configuration file "my.cnf" to avoid Log in to the mysql server with your password and use the update command to set a new password.
The operating environment of this tutorial: CentOS 6 system, mysql8 version, Dell G3 computer.
Solution to the forgotten mysql default password under centos
Method 1. Retrieve the initial password during installation:
Execute the following command directly
grep 'temporary password' /var/log/mysqld.log
##Method 2. Configure the my.cnf file, log in to the mysql server without a password, and use the update command Set a new password
#vim /etc/my.cnf(Note: windows The modification below is my.ini)
explicit_defaults_for_timestamp=true skip-grant-tables
service mysqld restart
mysql -uroot
use mysql update user set authentication_string=password(“123456”) where user=“root”;
mysql video tutorial)
The above is the detailed content of What should I do if I forget mysql default password under centos?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



CentOSStream8 system troubleshooting guide This article provides systematic steps to help you effectively troubleshoot CentOSStream8 system failures. Please try the following methods in order: 1. Network connection testing: Use the ping command to test network connectivity (for example: pinggoogle.com). Use the curl command to check the HTTP request response (for example: curlgoogle.com). Use the iplink command to view the status of the network interface and confirm whether the network interface is operating normally and is connected. 2. IP address and gateway configuration verification: Use ipaddr or ifconfi

Efficient training of PyTorch models on CentOS systems requires steps, and this article will provide detailed guides. 1. Environment preparation: Python and dependency installation: CentOS system usually preinstalls Python, but the version may be older. It is recommended to use yum or dnf to install Python 3 and upgrade pip: sudoyumupdatepython3 (or sudodnfupdatepython3), pip3install--upgradepip. CUDA and cuDNN (GPU acceleration): If you use NVIDIAGPU, you need to install CUDATool

When selecting a PyTorch version under CentOS, the following key factors need to be considered: 1. CUDA version compatibility GPU support: If you have NVIDIA GPU and want to utilize GPU acceleration, you need to choose PyTorch that supports the corresponding CUDA version. You can view the CUDA version supported by running the nvidia-smi command. CPU version: If you don't have a GPU or don't want to use a GPU, you can choose a CPU version of PyTorch. 2. Python version PyTorch

ZooKeeper troubleshooting guide for CentOS Systems This article provides a step-by-step guide to help you effectively troubleshoot ZooKeeper faults on CentOS systems. 1. Verify the status of ZooKeeper service: First, use the following command to check the status of ZooKeeper service: sudosystemctlstatuszookeeper If the service is not running, use the following command to start: sudosystemctlstartzookeeper To enable it to start by starting: sudosystemctlenablezookeeper2. Analyze the ZooKeeper log to check Z

Enable Redis slow query logs on CentOS system to improve performance diagnostic efficiency. The following steps will guide you through the configuration: Step 1: Locate and edit the Redis configuration file First, find the Redis configuration file, usually located in /etc/redis/redis.conf. Open the configuration file with the following command: sudovi/etc/redis/redis.conf Step 2: Adjust the slow query log parameters in the configuration file, find and modify the following parameters: #slow query threshold (ms)slowlog-log-slower-than10000#Maximum number of entries for slow query log slowlog-max-len

Detailed explanation of CentOS server PHP security policy: Building a solid protection system This article will explore in-depth how to build a secure PHP operating environment on the CentOS system, covering multiple aspects such as system level, PHP configuration, permission management, HTTPS encryption and security monitoring, etc., to help you effectively reduce the risk of server attacks. Server security is a continuous improvement process that requires regular review and updates to security policies. 1. System security cornerstone system update: Keep the latest version of the CentOS system and all software packages, install security patches in a timely manner, and plug known vulnerabilities. Firewall protection: Use Firewalld to finely control server network access, and only necessary ports (such as HTTP port 80 and H

Detailed explanation of MongoDB efficient backup strategy under CentOS system This article will introduce in detail the various strategies for implementing MongoDB backup on CentOS system to ensure data security and business continuity. We will cover manual backups, timed backups, automated script backups, and backup methods in Docker container environments, and provide best practices for backup file management. Manual backup: Use the mongodump command to perform manual full backup, for example: mongodump-hlocalhost:27017-u username-p password-d database name-o/backup directory This command will export the data and metadata of the specified database to the specified backup directory.

GitLab backup and recovery guide for CentOS system This article details how to backup and restore GitLab on CentOS system to ensure that your GitLab data is safe and reliable. Backup process Create backup: Use the command gitlab-rakegitlab:backup:create to create a complete backup of GitLab, including all key information such as Git repository, database, users, user groups, keys and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify gitlab_rails[' in the /etc/gitlab/gitlab.rb file
