Centos7 mariadb Set Root password

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.