centos7 mariadb set root password
Change root password
1. Login as root in the terminal, must
2. Enter mysqladmin-u root-p password root
The following root is the password to be set
3. Enter after carriage return password
Enter on the password, if not, enter directly
Create user
Create user
mysql> INSERT INTO Mysql.user (Host,user,password) VALUES ("localhost", "admin", Password ("admin"));
Refresh System Permissions Table
Mysql>flush privileges;
This creates a user named Admin password: admin.
Create a database (under root privileges)
Create DATABASE MyDB;
The authorized Admin user has all the permissions of the MyDB database.
>grant all privileges in mydb.* to [e-mail protected] identified by ' admin ';
Refresh System Permissions Table
Mysql>flush privileges;
Delete the user.
@>mysql-u root-p
@> Password
Mysql>delete from user WHERE user= "admin" and host= "localhost";
Mysql>flush privileges;
Delete a user's database
Mysql>drop database mydb;
modifies the specified user password.
@>mysql-u root-p
@> Password
Mysql>update Mysql.user Set Password=password (' New password ') where user= "admin" and host= "localhost";
Mysql>flush privileges;
This article is original, from the official website: http://www.lnoo.net/portal.php?mod=view&aid=60
Centos7 mariadb Set Root password