Depressed, Ubuntu in the command line MARIADB, the installation process does not appear the input root user interface, installed MARIADB, do not know the root user password, logged in as root to report the following error:
david@david-pc:~$ mysql-uroot-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Steps to resolve:
1.
sudo identity open/etc/mysql/my.cnf
Add the following code under the "Mysqld" node:
Skip-grant-tables #忽略密码授权
2.
Kill the MySQL process, restart mariadb, then directly mysql-uroot-p, without a password to log in to MySQL.
david@david-pc:/etc$ mysql-uroot-p
Enter Password:
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MariaDB Connection ID is 9
Server version:10.0.28-mariadb-1 Debian Unstable
Copyright (c), Oracle, MariaDB Corporation Ab and others.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
MariaDB [(None)]>
3.
After logging in, change the root password:
Use MySQL;
Update Mysql.user set Password=password (' Your_password ') where user= ' root ';
4.
sudo identity open/etc/mysql/my.cnf
Under the "mysqld" node, comment the following code:
#skip-grant-tables
5.
Restart MARIADB
sudo service MySQL restart