热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

linux下MySQL源码包的安装_MySQL

mysql安装   linux下MySQL源码包的安装   实验环境VMware6.5.2+redhatEnterprise5AS   实验目的初步涉及源码包的安装,以简单实现其功能为目的,不对原理进行深层讨论   内核版本: 
mysql安装

linux 下 MySQL源码包的安装
实验环境 VMware 6.5.2 +redhatEnterprise 5 AS
实验目的 初步涉及源码包的安装,以简单实现其功能为目的,不对原理进行深层讨论
内核版本:


今天尝试安装MySQL的源码包 mysql-4.0.27.tar.gz
下载源码包 copy 到linux
[root@localhost ~]# cd /tmp
[root@localhost tmp]# ls
gconfd-laowu scim-helper-manager-socket-root
gconfd-root scim-panel-socket:0-laowu
keyring-8zb2FJ scim-panel-socket:0-root
linuxqq_v1.0.2-beta1_i386 scim-socket-frontend-root
linuxqq_v1.0.2-beta1_i386.tar.gz sealert.log
mapping-laowu ssh-lgCAZY2854
mapping-root virtual-root.Kez8K1
mysql-4.0.27.tar.gz VMwareDnD
orbit-root vmware-root
scim-bridge-0.3.0.lockfile-0@localhost:0.0 VMwareTools-7.8.4-126130.tar.gz
scim-bridge-0.3.0.socket-0@localhost:0.0 vmware-tools-distrib
[root@localhost tmp]#
[root@localhost tmp]# tar zxvf mysql-4.0.27.tar.gz
把源码包mysql-4.0.27.tar.gz 解压到当前目录


[root@localhost tmp]# cd mysql-4.0.27
进入mysql-4.0.27目录
[root@localhost mysql-4.0.27]# ls
acconfig.h configure.in INSTALL-SOURCE missing regex
acinclude.m4 COPYING isam mkinstalldirs scripts
aclocal.m4 dbug libmysql myisam sql
bdb depcomp libmysqld myisammrg sql-bench
BUILD Docs libmysql_r mysql-test strings
ChangeLog EXCEPTIONS-CLIENT ltconfig mysys support-files
client extra ltmain.sh netware tests
config.guess heap Makefile.am os2 tools
config.h.in include Makefile.in pstack vio
config.sub innobase man readline
configure install-sh merge README
[root@localhost mysql-4.0.27]#
INSTALL-SOURCE这里面有你需要的安装命令
添加mysql用户组
[root@localhost mysql-4.0.27]# groupadd mysql
You have mail in /var/spool/mail/root
添加mysql用户 并指定到mysql组中
[root@localhost mysql-4.0.27]# useradd -g mysql mysql
[root@localhost mysql-4.0.27]#
[root@localhost mysql-4.0.27]# echo "/* Linuxthreads */" >> /usr/include/pthread.h
你也可以直接运行下面这条命令直接执行编译准备,如果有错误,试试上面得阴影部分命令
[root@localhost mysql-4.0.27]# ./configure --prefix=/usr/local/mysql
编译前的准备,指定安装目录到/usr/local/mysql
试计算机性能不同,时间略有差别


[root@localhost mysql-4.0.27]# make
编译过程


[root@localhost mysql-4.0.27]# make install
编译安装 稍等


[root@localhost mysql-4.0.27]# cp support-files/my-medium.cnf /etc/my.cnf
复制mysql配置文件
[root@localhost mysql-4.0.27]# cd /usr/local/mysql
进入安装目录
[root@localhost mysql]# bin/mysql_install_db --user=mysql
使用mysql用户 初始化数据库
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
090501 15:30:45 /usr/local/mysql/libexec/mysqld: Shutdown Complete
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 localhost.localdomain password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
[url]http://www.mysql.com[/url]
Support MySQL by buying support/licenses at [url]http://shop.mysql.com[/url]
[root@localhost mysql]#
[root@localhost mysql]# chown -R root .
改变当前目录的所有属主为root
-R 为递归(即其下所有的子文件的属主也随之改为root)
[root@localhost mysql]# chown -R mysql var
改变var的属主为mysql
[root@localhost mysql]# chgrp -R mysql .
改变当前目录的属组为mysql
[root@localhost mysql]#
[root@localhost mysql]# bin/mysqld_safe --user=mysql &
后台启动mysql服务 &为后台启动
[1] 17776
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/var
[root@localhost mysql]#
[root@localhost mysql]# /usr/local/mysql/bin/mysql
登陆到mysql数据库
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.27-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
mysql> show databases ;
基本的查看数据库命令
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.00 sec)
mysql>
mysql> ?
查询命令
For the complete MySQL Manual online visit:
[url]http://www.mysql.com/documentation[/url]
For info on technical support from MySQL developers visit:
[url]http://www.mysql.com/support[/url]
For info on MySQL books, utilities, consultants, etc. visit:
[url]http://www.mysql.com/portal[/url]
List of all MySQL commands:
(Commands must appear first on line and end with ';')
help (\h) Display this help.
? (\?) Synonym for `help'.
clear (\c) Clear command.
connect (\r) Reconnect to the server. Optional arguments are db and host.
edit (\e) Edit command with $EDITOR.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
nopager (\n) Disable pager, print to stdout.
notee (\t) Don't write into outfile.
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute a SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
system (\!) Execute a system shell command.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
Connection id: 2 (Can be used with mysqladmin kill)
mysql> quit
Bye
[root@localhost mysql]#
退出数据库

推荐阅读
  • PHP组合工具以及开发所需的工具
    本文介绍了PHP开发中常用的组合工具和开发所需的工具。对于数据分析软件,包括Excel、hihidata、SPSS、SAS、MARLAB、Eview以及各种BI与报表工具等。同时还介绍了PHP开发所需的PHP MySQL Apache集成环境,包括推荐的AppServ等版本。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • 腾讯安全平台部招聘安全工程师和数据分析工程师
    腾讯安全平台部正在招聘安全工程师和数据分析工程师。安全工程师负责安全问题和安全事件的跟踪和分析,提供安全测试技术支持;数据分析工程师负责安全产品相关系统数据统计和分析挖掘,通过用户行为数据建模为业务决策提供参考。招聘要求包括熟悉渗透测试和常见安全工具原理,精通Web漏洞,熟练使用多门编程语言等。有相关工作经验和在安全站点发表作品的候选人优先考虑。 ... [详细]
  • Django + Ansible 主机管理(有源码)
    本文给大家介绍如何利用DjangoAnsible进行Web项目管理。Django介绍一个可以使Web开发工作愉快并且高效的Web开发框架,能够以最小的代价构建和维护高 ... [详细]
  • 本文介绍了Perl的测试框架Test::Base,它是一个数据驱动的测试框架,可以自动进行单元测试,省去手工编写测试程序的麻烦。与Test::More完全兼容,使用方法简单。以plural函数为例,展示了Test::Base的使用方法。 ... [详细]
  • iOS Swift中如何实现自动登录?
    本文介绍了在iOS Swift中如何实现自动登录的方法,包括使用故事板、SWRevealViewController等技术,以及解决用户注销后重新登录自动跳转到主页的问题。 ... [详细]
  • 本文介绍了使用SSH免密登录的步骤,包括生成公私钥、传递公钥给被登录机、修改文件权限的操作。同时提醒用户注意私钥的传递方式,建议使用U盘等离线方式传递。 ... [详细]
  • Java学习笔记之使用反射+泛型构建通用DAO
    本文介绍了使用反射和泛型构建通用DAO的方法,通过减少代码冗余度来提高开发效率。通过示例说明了如何使用反射和泛型来实现对不同表的相同操作,从而避免重复编写相似的代码。该方法可以在Java学习中起到较大的帮助作用。 ... [详细]
  • SpringBoot整合SpringSecurity+JWT实现单点登录
    SpringBoot整合SpringSecurity+JWT实现单点登录,Go语言社区,Golang程序员人脉社 ... [详细]
  • 本文介绍了在RHEL 7中的系统日志管理和网络管理。系统日志管理包括rsyslog和systemd-journal两种日志服务,分别介绍了它们的特点、配置文件和日志查询方式。网络管理主要介绍了使用nmcli命令查看和配置网络接口的方法,包括查看网卡信息、添加、修改和删除配置文件等操作。 ... [详细]
  • Python脚本编写创建输出数据库并添加模型和场数据的方法
    本文介绍了使用Python脚本编写创建输出数据库并添加模型数据和场数据的方法。首先导入相应模块,然后创建输出数据库并添加材料属性、截面、部件实例、分析步和帧、节点和单元等对象。接着向输出数据库中添加场数据和历程数据,本例中只添加了节点位移。最后保存数据库文件并关闭文件。文章还提供了部分代码和Abaqus操作步骤。另外,作者还建立了关于Abaqus的学习交流群,欢迎加入并提问。 ... [详细]
  •     这里使用自己编译的hadoop-2.7.0版本部署在windows上,记得几年前,部署hadoop需要借助于cygwin,还需要开启ssh服务,最近发现,原来不需要借助cy ... [详细]
  • 大坑|左上角_pycharm连接服务器同步写代码(图文详细过程)
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了pycharm连接服务器同步写代码(图文详细过程)相关的知识,希望对你有一定的参考价值。pycharm连接服务 ... [详细]
  • linux 禁止指定ip访问
    linux中如何禁止指定的ip访问呢?比如被别人暴力破解,被别人使用不同的密码尝试登录:所以我想直接禁用这些ip的访问.怎么办呢?解决方案:修改配置文件etchosts.deny把 ... [详细]
author-avatar
殇心Long
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有