【MySQL】Summary of problems during installation and use

1. mysql mysqld is not an internal command

  • No environment variables are configured

2.mysqld --initialize --user==mysql 初始化时
​ Can’t create directory ‘D:\mysql5711\data’ (Errcode: 2 - No such file or directory)

  • The path in my.ini has not changed

3.mysqld --initialize --user==mysql 初始化时
​ [ERROR]–initialize specified but the data directory has files in it. Aborting.

  • data has been initialized, the second initialization will report this error

4. When net start mysql starts mysql

The MySQL service is starting.

MySQL service failed to start.

The service did not report any errors.

There is a process occupying the MySQL port number

Use: netstat -ano to view the process PID occupying the port number

Use: netstat -ano|findstr "4480" to view the information of a PID process

Use: taskkill /pid 4348 -f to kill the process

If System Error 5 Access Denied

use admin

5.mysql -u root -p when entering MySQL

Access denied for user ‘root’@‘localhost’ (using password: YES)’

1) MySQL service stop: restart the MySQL server net stop mysql; net start mysql;

2) The port number is inconsistent with the IP: open my.ini and modify the port number port

3) The my.ini configuration file is wrong: find a correct my.ini to replace

4) Wrong password:

​ Add skip-grant-tables under mysqld in my.ini so that login does not require authentication.

​ Restart mysql and reset the password

Guess you like

Origin blog.csdn.net/qq_41340996/article/details/124786404