1. CentOS 7.0 Version Information view
#cat/etc/redhat-release
2.
Install MARIADB
#yum-y Install mariadb*
3.Connect mariadb
Error: Error 2002 (HY000): Can ' t connect to the local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
4.solve the problem of not connecting
#systemctl Start Mariadb.service
#systemctl Enable Mariadb.service
# MySQL
5.Modify Root Password
Log in as root in the terminal, must
Enter mysqladmin-u root-p password root (this root is a password)
The following root is the password to set
Enter password appears after enter
Enter on the password, if not, direct return
6.Create a user
Create a user
mysql> INSERT INTO Mysql.user (Host,user,password) VALUES ("localhost", "admin", Password ("admin"));
Refresh System Permission Table
Mysql>flush privileges;
This creates a user named: admin Password: admin.
7.Create a database (under root permissions)
Create DATABASE MyDB;
Authorize the Admin user to have all the permissions for the MyDB database.
>grant all privileges in mydb.* to admin@localhost identified by ' admin ';
Refresh System Permission Table
Mysql>flush privileges;
8.deletes a 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;
9.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; 10.Navicat connection MySQL failed: Host ' * ' is not allowed to connect to-this MARIADB server
Problem Description: Navicat for easy administration, MySQL failed to connect Linux, such as The following error follows: Host ' * ' is not allowed to connect to this MARIADB server
//allow users to testuser from IP-222.129.1.1 hosts to MySQL server and use TESTPA ssWOrd as password mariadb [(none)]> grant all privileges on *.* to ' testuser ' @ ' 222.129.1.1 ' identified by ' Testpassword ' with grant option; (if you allow all ip:grant all privileges on *.* to ' testuser ' @ '% ') IDENTIFIED BY ' Testpassword ' WITH GRANT OPTION;) mariadb [(None )]> flush privileges; //Refresh permission cache mariadb [(none)]> show privileges; mariadb [(none)]> show grants for ' TestUser ' @ 222.129.1.1 ' 11. Delete an existing database
Using Rpm-qa | grep mariadb Search for mariadb existing packages:
If present, use rpm-e--nodeps mariadb-* Delete all: Remove MySQL All packages:
If present, use yum remove MySQL mysql-server mysql-libs compat-mysql51 all delete;