Installation and configuration of MySQL under Centos 7

Source: Internet
Author: User

First, the local Yum source should be set up, see URL (http://www.cnblogs.com/zj21/p/6223462.html).

Put the MySQL file installation package into the /var/opt folder

[email protected] ~]# Yum install/var/opt/*.*-y
[Email protected] ~]# systemctl restart Mysqld.service

[email protected] ~]# Yum install-y httpd
[email protected] ~]# Yum install-y MySQL
[email protected] ~]# Yum install-y php
[email protected] ~]# Yum install-y php-mysql

[Email protected] ~]# systemctl restart Httpd.service
[Email protected] ~]# Systemctl stop Firewalld.service
[Email protected] ~]# Setenforce 0

[Email protected] ~]# Cd/var/log
[[email protected] log]# cat mysqld.log View Database login password

[[email protected] ~]# mysql-uroot-p Login Database
Enter Password: enter password
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server version:5.7.16

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

mysql> alter user ' root ' @ ' localhost ' identified by ' QQQqqq111 ... '; To modify the database initial password
Query OK, 0 rows Affected (0.00 sec)

Mysql> Select User (); View User
+----------------+
| User () |
+----------------+
| [Email protected] |
+----------------+
1 row in Set (0.01 sec)

mysql> CREATE database Word; Create a database
Query OK, 1 row Affected (0.00 sec)

mysql> create user ' zxb ' @ ' 192.168.100.121 ' identified by ' QQQqqq111 ... '; New User Password
Query OK, 0 rows Affected (0.00 sec)

Mysql> grant all privileges in word.* to ' zxb ' @ ' 192.168.100.137 '; Permissions to the new user Word database
Query OK, 0 rows Affected (0.00 sec)

Mysql>


[[email protected] ~]# chmod o+w/var/www/html-r Write permissions to all users ' HTML folders

Put the WordPress Web site file into the/var/www/html folder

Installation and configuration of MySQL under Centos 7

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.