博主邮箱www.zzher@foxmail.com qq:1102471911

1 //获得以下所需的源代码包(文末附有安装包),并存放在/usr/local/src

2 //与mysql相关:3 boost_1_59_0.tar.gz cmake-3.6.2.tar.gz mysql-5.7.16.tar.gz4

5 //安装cmake前的依赖包的安装6 //检查gcc-c++ 、ncurses-devel是否安装,如果没有安装,先用yum进行安装7

8 编译安装cmake工具9 cd /usr/local/src

10 tar xf cmake-3.6.2.tar.gz11 cd cmake-3.6.2

12 ./bootstrap --prefix=/usr/local/cmake13 make14 make install #如果前面没有指定安装目录,则默认安装到/usr/local/bin/cmake15

16 建立mysql组和用户,并将mysql用户添加到mysql组17 groupadd mysql18 useradd -g mysql mysql19 创建mysql数据文件存放的目录20 mkdir /mydata

21 chown mysql:mysql /mydata

22 chmod o= /mydata #设置其他人没有任何权限

23

24 编译安装mysql25 cd /usr/local/src

26 tar xf mysql-5.7.16.tar.gz27 cd mysql-5.7.16

28 /usr/local/cmake/bin/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mydata -DWITH_BOOST=/usr/local/src -DSYSCONFDIR=/etc -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=0 -DMYSQL_MAINTAINER_MODE=0 -DWITH_SSL:STRING=bundled -DWITH_ZLIB:STRING=bundled

29 make &&make install30

31 更改mysql安装目录的属主属组并添加mysql环境变量32 chown -R mysql:mysql /usr/local/mysql

33 vim /etc/profile.d/mysql.sh

34 文件内容是:35 export PATH=$PATH:/usr/local/mysql/bin36 执行命令:37 bash #让新的PATH变量生效38

39 加入服务列表并设置为开机自启40 cd /usr/local/mysql/support-files41 cp mysql.server /etc/init.d/mysqld

42 chmod +x /etc/init.d/mysqld

43 chkconfig mysqld on44

45 修改mysql的配置文件46 cat /etc/my.cnf47

48 [mysql]49 socket=/tmp/mysql.sock50

51 [mysqld]52 datadir=/mydata

53 socket=/tmp/mysql.sock54 user=mysql55 symbolic-links=0

56

57 [mysqld_safe]58 log-error=/var/log/mysqld.log

59 pid-file=/mydata/mysqld.pid60

61 初始化mysql62 mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/mydata63 说明:64 ##“-–initialize”会生成一个随机密码(~/.mysql_secret),而”–initialize-insecure”不会生成密码 ##user表示指定用户 ##basedir表示mysql的安装路径,datadir表示数据库文件存放路径

65

66 启动mysql服务67 # service mysqld start68 查看MySQL服务的进程和端口69 # ps -ef |grep mysqld70 root 22306 1 0 12:51 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/mydata --pid-file=/mydata/web1.deng.com.pid

71 mysql 22480 22306 12 12:51 pts/0 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/mydata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/mydata/web1.deng.com.pid --socket=/tmp/mysql.sock72

73 # netstat -an | grep :3306

74 tcp 0 0 :::3306 :::*LISTEN75

76 初始化MySQL数据库的root用户密码77 # mysql_secure_installation78

79 Securing the MySQL server deployment.80

81 Connecting to MySQL using a blank password.82

83 VALIDATE PASSWORD PLUGIN can be used to test passwords84 and improve security. It checks the strength of password85 and allows the users to set only those passwords which are86 secure enough. Would you like to setup VALIDATE PASSWORD plugin?

87

88 Press y|Y for Yes, any other key forNo: y #需要修改密码,所以输入y89

90 There are three levels of password validation policy:91

92 LOW Length >= 8

93 MEDIUM Length >= 8, numeric, mixed case, and special characters94 STRONG Length >= 8, numeric, mixed case, special characters and dictionary file95

96 Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2#设置密码复杂度为强97 Please set the password forroot here.98

99 New password:100

101 Re-enter newpassword: #输入2次新密码102

103 Estimated strength of the password: 100

104 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key forNo) : y105 By default, a MySQL installation has an anonymous user,106 allowing anyone to log into MySQL without having to have107 a user account created for them. This is intended only for

108 testing, and to make the installation go a bit smoother.109 You should remove them before moving into a production110 environment.111

112 Remove anonymous users? (Press y|Y for Yes, any other key forNo) : y #删除匿名用户113 Success.114

115

116 Normally, root should only be allowed to connect from117 'localhost'. This ensures that someone cannot guess at118 the root password from the network.119

120 Disallow root login remotely? (Press y|Y for Yes, any other key forNo) : y #禁止root远程登录121

122 ... skipping.123 By default, MySQL comes with a database named 'test'that124 anyone can access. This is also intended only fortesting,125 and should be removed before moving into a production126 environment.127

128

129 Remove test database and access to it? (Press y|Y for Yes, any other key forNo) : y #删除测试数据库130 -Dropping test database...131 Success.132

133 -Removing privileges on test database...134 Success.135

136 Reloading the privilege tables will ensure that all changes137 made so far will take effect immediately.138

139 Reload privilege tables now? (Press y|Y for Yes, any other key forNo) : y #重新加载权限表140 Success.141

142 All done!

143

144 将MySQL数据库的动态链接库共享至系统链接库145 vim /etc/ld.so.conf.d/mysql.conf

146 文件内容是:147 /usr/local/mysql/lib148

149 ldconfig -v 让系统重新读取库文件150

151 测试登陆MySQL数据库152 # mysql -uroot -p153 Enter password: #输入刚才设置的新密码154 Welcome to the MySQL monitor. Commands end with; or \g.155 Your MySQL connection id is 5

156 Server version: 5.7.14Source distribution157

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

159

160 Oracle is a registered trademark of Oracle Corporation and/or its

161 affiliates. Other names may be trademarks of their respective162 owners.163

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

166 mysql>show databases;167 +--------------------+

168 | Database |

169 +--------------------+

170 | information_schema |

171 | mysql |

172 | performance_schema |

173 | sys |

174 +--------------------+

175 4 rows in set (0.00sec)176

177 mysql>exit178 Bye

Linux mysql.plugin_Linux下MySQL安装相关推荐

  1. weblogic 64位 linux,weblogic在linux和window下的安装

    weblogic在linux和window下的安装 Windows server2008 一直下一步没什么坑 centos6.5 使用rpm安装jdk8 安装jdl rpm -ivh jdk-8u19 ...

  2. Linux(CentOS6.5)下编译安装Nginx1.10.1

    原文出自:http://www.cnblogs.com/comexchan/p/5815753.html Linux(CentOS6.5)下编译安装Nginx1.10.1 首先在特权账号(root)下 ...

  3. Linux系统CentOS下mysql的安装日志

    今天自己捣鼓了一下,在linux系统CentOs6.5下使用源码方式安装和配置mysql,这里记录一下步骤. a) 下载mysql,source版本.Mysql-5.6.20.tar.gz b) 安装 ...

  4. mysql linux c tar_linux下mysql的tar包离线安装

    linux下mysql的tar包离线安装 1.确保mysql安装之前有libaio依赖 yum search libaio yum install libaio 2.下载mysql的tar离线包 下载 ...

  5. Linux CentOS6.5下编译安装MySQL 5.6.16【给力详细教程】

    http://blog.csdn.net/wendi_0506/article/details/39478369 启动mysql /usr/local/mysql/support-files/mysq ...

  6. linux 配置 mysql_linux下mysql配置文件my.cnf最详细解释

    MySQL配置文件在Windows下叫my.ini,在MySQL的安装根目录下:在Linux下叫my.cnf,该文件位于/etc/my.cnf. 可以查找下:find / -name my.cnf m ...

  7. -bash: cd: /usr/bin/mysql:_linux下mysql的卸载、安装全过程amp;amp;mysql安装后bash:mysql:command not found...

    http://blog.sina.com.cn/s/blog_48d5933f0100ts7t.html 卸载mysql 1.查找以前是否装有mysql 命令:rpm -qa|grep -i mysq ...

  8. nginx 怎么重新编译安装mysql,centos 下 编译安装 nginx + mysql + php 服务

    centos 下编译安装nginx + mysql + php 服务 1.安装nginx 1.1.安装依赖包 yum install wget make gcc gcc-c++ pcre-devel ...

  9. mysql pkg_Solaris10下mysql的pkg安装方法

    以root登录系统 1从dev.mysql.com网站下载安装文件mysql-5.1.11-beta-solaris10-sparc-64bit.pkg.gz保存到/tmp 2解压缩gz格式安装文件g ...

最新文章

  1. 暗物质组成原理当然是不存在计算机,暗物质能组成生命吗?小部分暗物质可能会相互作用...
  2. c++函数不允许递归_面试算法题:不会递归函数被面试官刷了下来!
  3. 【Linux】VMware连接CRT
  4. 在Hisi3531环境中为wm8978芯片添加音量调节功能及测试
  5. 电脑“减负”必备,分享一款优秀的重复文件查找工具
  6. STM32F103_study66_The punctual atoms(STM32 Temperature sensor experiment)
  7. 什么是过拟合?过拟合的10个解决办法都有哪些?
  8. HTML显示json字符串并且进行格式化
  9. 【学习笔记】Docker基础实战教程一:入门
  10. 《炒股的智慧》第5节文摘
  11. 【MATLAB教程案例86】通过matlab实现lorenz混沌系统
  12. 求的带权图最小生成树的Prim算法和Kruskal算法
  13. 开发者测试笔记08--ASAN、TSAN、UBSAN、KASAN使用总结
  14. python中 ... 的作用
  15. 《解析卷积神经网络—深度学习实践手册》—学习笔记
  16. 前端工程化: 脚手架+物料库快速生成新项目
  17. 极验滑块验证码破解与研究(三):滑块缺口识别
  18. 《CISP》(七)信息安全支撑技术——访问控制
  19. 51Testing独家连载:(七)精通QTP——自动化测试技术领航
  20. 计算任意半径的圆的面积

热门文章

  1. c#生成一组不同的随机数的方法
  2. 华为交换机S3700-TELNET远程管理交换机配置
  3. centos7 配置http服务器
  4. js中toFixed方法的两个坑
  5. php实现ftp上传,PHP_PHP实现ftp上传文件示例,FTP上传是PHP实现的一个常见且 - phpStudy...
  6. scala与java的区别_Scala学习笔记及与Java不同之处总结
  7. 网页版bpc电波对时_科普向:无需联网却能自动对时的钟表
  8. Win7电脑快速获取超级管理员权限的方法
  9. 火狐浏览器如何禁止网站发消息 火狐浏览器禁止网站发消息的方法
  10. 手机优酷APP怎么上传视频