mysql 5.1编译参数和编译方法

2024-06-27 05:16:35

一。下载:

1.wget

2.解压

二。编译:

1.参数:

wKiom1RBvLKDByG4AAKY1hM0Mb0930.jpg

  ./configure \
--prefix=/usr/local/mysql \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--localstatedir=/usr/local/mysql/data \
--enable-assembler \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pthread \
--with-extra-charsets=complex \
--with-readline \
--with-ssl \
--with-embedded-server \
--enable-local-infile \
--with-plugins=partition,innobase \--with-plugin-PLUGIN \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static2.make && make intall
3.复制mysql配置文件,此处为测试,使用占用资源最少的small.cnfcp my-small.cnf /etc/my.cnf

4.建立安装文件目录。并把文件夹的属主递归改为mysql

mkdir -p /usr/local/mysql

chown -R mysql.mysql /usr/local/mysql/

5.安装数据库:

/usr/local/mysql/bin/mysql_install_db --user=mysql

6.修复警告

WARNING: The host 'ser200' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
141018 15:29:28 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
141018 15:29:28 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h ser200 password 'new-password'

VI修改hosts文件,增加mysql

[root@ser200 data]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               mysql ser150    localhost
::1             localhost6.localdomain6 localhost6

7.增加环境变量mysql路径

[root@ser200 data]# echo "export PATH=$PATH:/usr/local/mysql/bin">> /etc/profile

[root@ser200 data]# . /etc/profile
[root@ser200 data]# echo $PATH

8.增加mysql 自启动和init.d的服务器启动2种方式

[root@ser200 data]# cp /home/oldboy/tools/mysql-5.1.73/support-files/mysql.server /etc/init.d/mysqld
[root@ser200 data]# chmod 700 /etc/init.d/mysqld
[root@ser200 data]# ll /etc/init.d/mysqld
-rwx------ 1 root root 12533 Oct 18 15:54 /etc/init.d/mysqld

===========================================================

[root@ser200 data]# chkconfig --add mysql

[root@ser200 data]# chkconfig --list|grep mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off

9.删除mysql库user表多余的用户

mysql> select user,host from user;    
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
|      | localhost |
| root | localhost |
|      | ser200    |
| root | ser200    |
+------+-----------+
5 rows in set (0.00 sec)

mysql> drop user ""@localhost

mysql> drop user ""@ser200

mysql>drop user root@ser200

mysql> drop user root@ser200

转载于:https://blog.51cto.com/txidc/1565365

mysql 5.1编译参数和编译方法相关推荐

  1. Linux环境编译安装Mysql以及补装innodb引擎方法

    mysql安装  5.6以后可能会收费,所以选择5.1 以下从台湾中山大学镜像下载 1.首先要安装C++编译环境 # yum install gcc-c++ 2.下载解压 # wget http:// ...

  2. mysql基础(一) 编译安装mysql5.5

    一:编译mysql useradd -M -s /sbin/nologin mysql                #创建mysql用户 yum -y install cmake           ...

  3. 最全的mysql 5.7.13_最全的mysql 5.7.13 安装配置方法图文教程(linux) 强烈推荐!

    linux环境Mysql 5.7.13安装教程分享给大家,供大家参考,具体内容如下 1系统约定 安装文件下载目录:/data/software Mysql目录安装位置:/usr/local/mysql ...

  4. 修改MYSQL最大连接数的3种方法

    MYSQL数据库安装完成后,默认最大连接数是100,一般流量稍微大一点的论坛或网站这个连接数是远远不够的,增加默认MYSQL连接数的方法有两个 方法一:进入MYSQL安装目录 打开MYSQL配置文件 ...

  5. Linux/CentOS安装MySQL(RPM安装、编译安装)

    2019独角兽企业重金招聘Python工程师标准>>> Linux/CentOS安装MySQL(RPM安装.编译安装) 目前最常用的MySQL安装方法也就是采用Yum安装RPM包,或 ...

  6. mysql 5.7 源码编译安装_mysql-5.7.*源码编译安装

    mysql-5.7.*源码编译安装 系统安装条件 官方文档说明:http://dev.mysql.com/doc/refman/5.7/en/source-installation.html 1> ...

  7. lnk2019 mysql_C++使用MySQL-Connector/C++连接MySQL出现LNK2019错误的解决方法

    C++使用MySQL-Connector/C++连接MySQL出现LNK2019错误的解决方法 使用vs2015开发c++win32项目时,用MySQL-Connector/c++连接MySQL时总是 ...

  8. 【全教程】qt连接mysql——从qt编译mysql驱动到qt连接mysql数据库(一、编译连接前准备)

    一.说明 电脑系统:win10 qt版本:5.13.2和5.14.1(测试均成功) mysql版本:MySQL-5.5 本篇教程分为三个部分: [全教程]qt连接mysql--从qt编译mysql驱动 ...

  9. MySQL数据库常见错误与解决方法总结

    一.Can't connect to MySQL server on 'localhost' (10061) 翻译:不能连接到 localhost 上的mysql 分析:这说明"localh ...

最新文章

  1. 【SSM框架系列】SpringMVC基本介绍
  2. iReport 5.添加修改删除jdbc
  3. 字节输出流写多个字节的方法
  4. Tomcat开发Web项目基本结构
  5. 页面跳转多种方法(加传参)
  6. 面试官:能说说Redis的持久化机制吗?
  7. 【XLL 框架库函数】 Excel/Excel12f
  8. python练手经典100例-【Python精华】100个Python练手小程序
  9. 【金蝶K3Cloud】 Python套打插件开发记录
  10. paip.win32的internet扩展已停止工作解决大法
  11. 一天搞懂深度学习(李宏毅)-学习笔记
  12. 怎么恢复苹果内置的计算机,苹果还原系统的方法_苹果电脑Mac如何恢复出厂系统-win7之家...
  13. PWM驱动MOS管H桥电路
  14. Layabox 2 使用其它编辑器开发layabox2d
  15. java: Compilation failed: internal java compiler error
  16. Solidworks绘制齿轮过程备注
  17. java将英文字符(无论大小写)转化为小写
  18. 绝地求生显示lsukn服务器,电脑中玩绝地求生出现Failed to initialize BattlEye Service:Generic Error怎么办...
  19. FL Studio20.9中文版最详细的安装激活教程
  20. 【笔记】DenseTNT:End-to-end Trajectory Prediction from Dense Goal Sets

热门文章

  1. 了解一下JavaScript的未来——ECMAScript5
  2. easyui datagrid 浏览器像素及改变表、列宽问题
  3. 深入理解.net服务器控件
  4. 促进儿童语言发展的方法
  5. SpringSecurity注销功能
  6. 副本的leader选举
  7. 释放锁的逻辑-InterProcessMutex.release
  8. 委派模式与策略模式综合应用
  9. mybatis简介-什么是Mybatis
  10. (常用API)正则表达式匹配练习