centos7 mounting MySql (yum embodiment)


1. Installation yum
yum the install lrzsz -Y
2. Source mounted wget for downloading the installation package mysql
yum the install wget
3. mysql download source installation package
wget http://dev.mysql.com/get/mysql57-community-release-el7 -8.noarch.rpm
4. mysql installation source
yum localinstall mysql57-Community-Release-el7-8.noarch.rpm
5. The check is successfully installed mysql source
yum repolist Enabled |. "mysql * - * Community." grep
. 6. modify the vim /etc/yum.repos.d/mysql-community.repo source is changed mysql version installed by default.
To install such version 5.6, the source is enabled 5.7 = 1 change enabled = 0. Then enabled 5.6 source = 0 enabled = 1 can be changed.
7. Install MySQL
yum the install-MySQL-Community Server
8. The start MySQL service
systemctl start mysqld
stop MySQL service
systemctl STOP mysqld
9. The boot msql service
systemctl enable mysqld
systemctl daemon-reload
10. Enter mysql
mysql -u root
Show Databases; check the database
to exit the MySQL
Exit
11. Set password
to create a server
GRANT ALL PRIVILEGES ON * * TO ' root' @ '%' IDENTIFIED BY 'root' WITH GRANT OPTION;.
To enter the mysql database
use mysql;
see user tables
select host, user, password from user ;
delete other users in addition to%
the delete user from the WHERE Host = '%';!
quit restart the MySQL service
exit
systemctl Start mysqld
systemctl STOP mysqld
re-enter MySQL
MySQL -u root - p
cryptographic
the root
12. the process mysql Chinese distortion
view mysql encoding format
show variables like 'character%';
edit profile
vim /etc/my.cnf
inserted in a first row [mysqld]
Character-Server-SET = UTF8
In the final insertion
[Client]
default = UTF8-Character-SET
[mysql]
default = SET-Character-UTF8
13. mysql import database files
source path

Guess you like

Origin www.cnblogs.com/wangmeng960111/p/10990057.html