我需要完全删除有关 MySQL 的所有内容。它没有开始,所以我决定删除它。但是在安装过程中发生了这种情况:
sta@daPC:~$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libdbd-mysql-perl libmysqlclient18 mysql-client-5.6 mysql-common
mysql-server-5.6
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
libdbd-mysql-perl libmysqlclient18 mysql-client-5.6 mysql-common
mysql-server mysql-server-5.6
0 upgraded, 6 newly installed, 0 to remove and 87 not upgraded.
Need to get 0 B/12,0 MB of archives.
After this operation, 101 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 188526 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.6.28-0ubuntu0.15.10.1_all.deb ...
Unpacking mysql-common (5.6.28-0ubuntu0.15.10.1) ...
Selecting previously unselected package libmysqlclient18:i386.
Preparing to unpack .../libmysqlclient18_5.6.28-0ubuntu0.15.10.1_i386.deb ...
Unpacking libmysqlclient18:i386 (5.6.28-0ubuntu0.15.10.1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.028-2_i386.deb ...
Unpacking libdbd-mysql-perl (4.028-2) ...
Selecting previously unselected package mysql-client-5.6.
Preparing to unpack .../mysql-client-5.6_5.6.28-0ubuntu0.15.10.1_i386.deb ...
Unpacking mysql-client-5.6 (5.6.28-0ubuntu0.15.10.1) ...
Processing triggers for man-db (2.7.4-1) ...
Setting up mysql-common (5.6.28-0ubuntu0.15.10.1) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.6.
(Reading database ... 188621 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.28-0ubuntu0.15.10.1_i386.deb ...
Unpacking mysql-server-5.6 (5.6.28-0ubuntu0.15.10.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.6.28-0ubuntu0.15.10.1_all.deb ...
Unpacking mysql-server (5.6.28-0ubuntu0.15.10.1) ...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (225-1ubuntu9) ...
Setting up libmysqlclient18:i386 (5.6.28-0ubuntu0.15.10.1) ...
Setting up libdbd-mysql-perl (4.028-2) ...
Setting up mysql-client-5.6 (5.6.28-0ubuntu0.15.10.1) ...
Setting up mysql-server-5.6 (5.6.28-0ubuntu0.15.10.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
2016-02-17 04:13:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-02-17 04:13:48 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28-0ubuntu0.15.10.1) starting as process 13491 ...
Run Code Online (Sandbox Code Playgroud)
如您所见,它再次启动 MySQL 服务器时卡住了。如何删除MySQL的完全全新安装?
编辑:重新启动计算机后问题自行解决。由于我既无法检测到问题,也无法检测到实际解决方案,因此我不会将其发布为答案。
小智 35
我在以下位置找到了解决方案:https : //stackoverflow.com/questions/25244606/completely-remove-mysql-ubuntu-14-04-lts/28113482#28113482
sudo rm -rf /var/lib/mysql/mysql
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server
Run Code Online (Sandbox Code Playgroud)
在重新安装过程中,系统提示我输入(新)密码。在之前重新安装不成功的过程中,我让它为空,而 mysql 保留了之前安装时忘记的旧密码,我认为它是空的。
您必须使用清除:
remove
remove is identical to install except that packages are removed
instead of installed. Note the removing a package leaves its
configuration files in system. If a plus sign is appended to the
package name (with no intervening space), the identified package
will be installed instead of removed.
purge
purge is identical to remove except that packages are removed and
purged (any configuration files are deleted too).
--purge
Use purge instead of remove for anything that would be removed. An
asterisk ("*") will be displayed next to packages which are
scheduled to be purged. remove --purge is equivalent for purge
command. Configuration Item: APT::Get::Purge.
Run Code Online (Sandbox Code Playgroud)
句法:
sudo apt-get remove --purge <package-name>
Run Code Online (Sandbox Code Playgroud)
或其等价物:
sudo apt-get purge <package-name>
Run Code Online (Sandbox Code Playgroud)
希望能帮助到你。
| 归档时间: |
|
| 查看次数: |
63054 次 |
| 最近记录: |