首页 > 代码库 > Centos 7 mysql 安装记

Centos 7 mysql 安装记

自从某次在美团云把1G 1核的 centos 7 装到死机,我就断了源码编译安装mysql的心思。

本次实践历程如下

  • 安装命令
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install mysql-community-server
  • 配置mysql
service mysqld restart

mysql -u root
mysql> set password for root@localhost =password(vm_52.102);    

 

[root@localhost liuhui]# service mysqld restart
Redirecting to /bin/systemctl restart  mysqld.service
[root@localhost liuhui]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.34 MySQL Community Server (GPL)

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

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> set password for root@localhost =password(‘password);
Query OK, 0 rows affected (0.00 sec)

 

Centos 7 mysql 安装记