MySQL Learning (a)-start and login MySQL problems encountered and resolved

Source: Internet
Author: User

1. MySQL uses the command line to start the Times wrong "system error 5 occurred", as follows:

Cause: The CMD program is not running as an administrator

Solution: Locate the command Prompt in the Start menu, right-click to select Run as Administrator

2, the login times wrong "Prompt MySQL is not an internal or external command, is not a running program or batch file"

Solution: Configure Environment variables (right-click My Computer, advanced system settings, environment variables, select the MySQL-installed directory, locate the bin directory in the MySQL-installed directory, and copy this path. Select the System path-> edit, add the path you just copied)

3, when forget MySQL database username password, always login failed, prompt "Access denied for user '-P ' @ ' localhost '"

Solution:

1) End the MYSQLD task process in Task Manager first

2) windows+r Open cmd command prompt, enter mysqld--skip-grant-tables (Purpose: Skip the MySQL user authentication, without entering user name and password can directly login) as follows:

3) re-open a cmd command prompt interface , enter MySQL after you do not need a user name and password to log in successfully

show databases; View database (proves successful login)

Update user set Password=password (' 12345 ') where user= ' root ' and host= ' localhost '; To modify a database password

Quit;

Mysql-u User name-p new password; You'll be able to log back in with your username and password.

MySQL Learning (a)-start and login MySQL problems encountered and resolved

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.