在运维或者开发过程中,经常会遇见部署各类LNMP或者LAMP模式的系统运行架构,尤其再部署数据库时,往往有人对数据库使用过程倒是很多,但从头部署的情况少有发生,今天推荐一种简单的mysql安装操作:这简单是真正的简单
简单的解决方案:
1、yum源安装
#yum install #下载及安装yum源 #yum clean all #清理yum #yum makecache #重新缓存 #yum install mysql-community-server #yum安装 就这么简单
2、开启服务
#/etc/init.d/mysqld
3、查找初始密码并修改
#grep 'temporary password' /var/log/mysqld.log #唯一不同的就是此处,安装完成后会有一个初始密码放置到log中,进行初始登录 # grep 'temporary password' /var/log/mysqld.log 2018-07-27T11:00:07.016171Z 1 [Note] A temporary password is generated for root@localhost: xxxxx # mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 4 Server version: 5.7.22 Copyright (c) 2000, 2018, 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> #强制修改密码,否则无法使用。 mysql> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> set password=password('test123'); #密码复杂度要求。 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements #复杂度提高后成功。 mysql> set password=password('Test@!234'); Query OK, 0 rows affected, 1 warning (0.00 sec)
4、yum安装过程中的会出现依赖程序问题,只需要先安装一下依赖即可
#yum install mysql-devel
通过以上简单安装步骤即可完成一键部署操作(需要整理方可成一键)
在运维或者开发过程中,经常会遇见部署各类LNMP或者LAMP模式的系统运行架构,尤其再部署数据库时,往往有人对数据库使用过程倒是很多,但从头部署的情况少有发生,今天推荐一种简单的mysql安装操作:这简单是真正的简单
简单的解决方案:
1、yum源安装
1
2
3
4
|
#yum install #下载及安装yum源 #yum clean all #清理yum #yum makecache #重新缓存 #yum install mysql-community-server #yum安装 就这么简单 |
2、开启服务
1
|
#/etc/init.d/mysqld |
4、查找初始密码并修改
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#grep 'temporary password' /var/log/mysqld.log #唯一不同的就是此处,安装完成后会有一个初始密码放置到log中,进行初始登录 # grep 'temporary password' /var/log/mysqld.log 2018-07-27T11:00:07.016171Z 1 [Note] A temporary password is generated for root@localhost: xxxxx # mysql -uroot -p Enter password : Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 4 Server version: 5.7.22 Copyright (c) 2000, 2018, 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> #强制修改密码,否则无法使用。 mysql> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> set password = password ( 'test123' ); #密码复杂度要求。 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements #复杂度提高后成功。 mysql> set password = password ( 'Test@!234' ); Query OK, 0 rows affected, 1 warning (0.00 sec) |