Recently in an attempt to deploy OpenStack based on Ubuntu 16.04.1 LTS Server, I encountered mariadb unable to link properly during the deployment process.
Problem
Refer to OpenStack official documentation to install MARIADB and encounter an issue that cannot be logged on locally after installation
$mysql-u root-p$mysql-h localhost-u root-p
The error is as follows
MySQL (mariadb) ERROR 1698 (28000): Access denied for user ' root ' @ ' localhost '
But you can log in using the following method
$sudo Mysql-u Root
Thus uninstalling the mariadb, but the unloading method is more violent, resulting in the re-installation of the Times similar to the following error
Dpkg:warning:while removing mariadb-server-core-10.0, directory '/usr/share/mysql ' not empty so removeddpkg:error p Rocessing Package mariadb-server-10.0 (--configure): subprocess installed post-installation script returned error exit St ATUs 1 Errors were encountered while processing:mariadb-server-10.0 E:sub-process/usr/bin/dpkg returned an error CodE: Sub-process/usr/bin/dpkg returned an error code (1)
Solution Solutions
First, the uninstall method, the correct way to uninstall the software through the Package Manager is as follows
Apt purge mariadb* mysql*apt autoremoveapt AutoClean
If you encounter the above error when reinstalling, you can try to force the installation (apt install-f), reinstall (APT--reinstall install), correct unloading method (apt purge mariadb && apt Autoremove & amp;& apt AutoClean)
If you rely on warnings, install the corresponding dependencies directly
Now, let's talk about the solution to mariadb.
Through repeated attempts, the final resolution is resolved by installing a later version.
Prior to the installation is to refer to the official OpenStack document, installed mariadb-server-10.0, many attempts after the problem still exists, in the thought of MARIADB official looking for documents to see.
The result document was not found, but found the official installation documentation, and the reference MARIADB Official document installed the latest stable version mariadb-server-10.1
During the installation, the new version will require the MARIADB root user password to be set, but 10.0 does not. Also during the uninstallation process, you are prompted to confirm the deletion of all database files, which are not available in version 10.0.
Once the 10.1 version of MARIADB is installed, it is ready to connect properly.
Summarize
Through repeated attempts, the basic can be judged to be installed MARIADB version (or the corresponding system) is not correct, but also may be 10.0 version of this problem.
If you encounter a similar problem again, you can try to install a different version of the software, or change the path of the installation.
This article is from the "Morrowind" blog, make sure to keep this source http://morrowind.blog.51cto.com/1181631/1834078
Mariadb Install on Ubuntu 16.04.1 LTS