Here we sit down notes for future inquiries and hope to the students in need can also provide a reference:
Operating environment:
1.cat / proc / version information to check the current version
2. Check whether the machine installation information of mysql
Command: ls -1 /etc/yum.repos.d/mysql-community*
or
命令:yum repolist enabled | grep "mysql.*-community.*"
I this is already installed, it will display this information, if you can also have a direct step 4, if not please continue to look at Step 3
3 yum Repository information about installing the mysql
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
The rpm of the package to the yum
rpm -ivh mysql-community-release-el7-5.noarch.rpm
Then repeat steps 2, confirm mysql installation information already exists in the yum if does not exist, inspecting the step itself.
4 install mysql
yum install mysql-server
This, mysql installation has been completed
5 landing mysql
5.1 start mysql service
service mysqld start
5.2 landing mysql service
First Landing username is root password is empty
mysql -h localhost -uroot -p
Landed successfully!
5.3 add a normal user (root / root123)
create user 'root'@‘%’ identified by 'root123';
Add permissions (not create rights)
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'root'@'%';
5.4 add an administrative user (admin / 1q2w3e4r)
create user 'admin'@'%' identified by '1q2w3e4r';
grant all on *.* to 'admin'@'%';
6 登陆
OK 到此mysql数据库已经完全搭建完毕啦!希望对大家有所帮助!!!