Under the full version of linux install mysql database
- Uninstall MariaDB , or install mysql conflict occurs
- Execute the command rpm -qa | grep mariadb
- List all installed mariadb rpm packet;
- Execute the command rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
- The official added yum source to create and edit mysql-community.repo file
a) vi /etc/yum.repos.d/mysql-community.repo
b) attached to the source file following
[mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/ enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql |
c) Note : If you need to install mysql5.7 only need to baseurl modification to
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
- Install mysql database
a) sudo yum install mysql-community-server
- Start mysql database
a) sudo service mysqld start
- Modify the mysql default root user password
a) mysqladmin -u root -p password your new password
b) Note :
-
- mysql5.7 initial password is randomly generated, placed /var/log/mysqld.log use the command grep 'temporary password' /var/log/mysqld.log read out to
The Mysql database can be accessed remotely
1, the implementation of mysql -u root -p
Figure:
This time not on the line directly enter a password, enter mysql execution mode
2, after the show databases to see if the implementation of the database to see the note must add a semicolon
3, use mysql executed after completion.
Inquiries about the user tables select user, host, passowrd from user ; see multiple rows of data:
(Since I deal with here over so the rest of a data)
Your queries should be out of five.
Then delete from user where password = '' ; deleting the four pieces of data (password is empty);
Then update user set host = '%' ;
The host field to No. wildcard%; the rest of the table because we do not add a data where the conditions of;
Finally, the implementation of some flush privileges; refresh on the line;
So easily connected.