mysql- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
1.安装了DVWA后,发现mysql不能正常打开了
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
2.查看安装了哪些mysql:
sudo dpkg -l | grep mysql
ii libmysqlclient-dev 8.0.35-0ubuntu0.22.04.1 amd64 MySQL database development files
ii libmysqlclient21:amd64 8.0.35-0ubuntu0.22.04.1 amd64 MySQL database client library
ii mysql-client 8.0.35-0ubuntu0.22.04.1 all MySQL database client (metapackage depending on the latest version)
ii mysql-client-8.0 8.0.35-0ubuntu0.22.04.1 amd64 MySQL database client binaries
ii mysql-client-core-8.0 8.0.35-0ubuntu0.22.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.8+1.0.8 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii mysql-server 8.0.35-0ubuntu0.22.04.1 all MySQL database server (metapackage depending on the latest version)
ii mysql-server-8.0 8.0.35-0ubuntu0.22.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-8.0 8.0.35-0ubuntu0.22.04.1 amd64 MySQL database server binaries
ii php8.1-mysql 8.1.2-1ubuntu2.14 amd64 MySQL module for PHP
sudo dpkg -l | grep mysql
ii php8.1-mysql 8.1.2-1ubuntu2.14 amd64 MySQL module for PHP
单独卸载php8.1-mysql
sudo apt remove php8.1-mysql
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED
php8.1-mysql
0 to upgrade, 0 to newly install, 1 to remove and 89 not to upgrade.
After this operation, 462 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 423421 files and directories currently installed.)
Removing php8.1-mysql (8.1.2-1ubuntu2.14) ...
Processing triggers for libapache2-mod-php8.1 (8.1.2-1ubuntu2.14) ...
done!
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-server-8.0 (8.0.35-0ubuntu0.22.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Cannot stat file /proc/18746/fd/1023: Permission denied
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 21420
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Setting up mysql-server (8.0.35-0ubuntu0.22.04.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.4) ...