mysql登录遇到ERROR2002:Can‘tconnecttoMySQLserveron‘localhost‘解决办法
时间:2023-08-02
C:UsersAdministrator>mysql -uroot -proot
ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:UsersAdministrator>net start mysql
服务名无效。
E:MariaDBbin>mysql -u root -p
Enter password: ****
ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061)
E:MariaDBbin>mysqld -install mysql
Service successfully installed、
E:MariaDBbin>net start mysql
mysql 服务正在启动 ..
mysql 服务已经启动成功。
E:MariaDBbin>mysql -uroot -proot
Welcome to the MariaDB monitor、 Commands end with ; or g.
Your MariaDB connection id is 8
Server version: 10.3.7-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help、Type 'c' to clear the current input statement.
MariaDB [(none)]>quit
Bye
E:MariaDBbin>c:
C:UsersAdministrator>mysql -uroot -proot
Welcome to the MariaDB monitor、 Commands end with ; or g.
Your MariaDB connection id is 14
Server version: 10.3.7-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help、Type 'c' to clear the current input statement.
MariaDB [(none)]>