搜尋
首頁資料庫mysql教程linux 下 MySQL源码包的安装_MySQL

mysql安装

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

linux 下 MySQL源码包的安装_MySQL


    今天尝试安装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 解压到当前目录

linux 下 MySQL源码包的安装_MySQL


    [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
    试计算机性能不同,时间略有差别

linux 下 MySQL源码包的安装_MySQL


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

linux 下 MySQL源码包的安装_MySQL


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

linux 下 MySQL源码包的安装_MySQL


    [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]#
    退出数据库

 

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
什么是linux设备节点什么是linux设备节点Apr 18, 2022 pm 08:10 PM

linux设备节点是应用程序和设备驱动程序沟通的一个桥梁;设备节点被创建在“/dev”,是连接内核与用户层的枢纽,相当于硬盘的inode一样的东西,记录了硬件设备的位置和信息。设备节点使用户可以与内核进行硬件的沟通,读写设备以及其他的操作。

Linux中open和fopen的区别有哪些Linux中open和fopen的区别有哪些Apr 29, 2022 pm 06:57 PM

区别:1、open是UNIX系统调用函数,而fopen是ANSIC标准中的C语言库函数;2、open的移植性没fopen好;3、fopen只能操纵普通正规文件,而open可以操作普通文件、网络套接字等;4、open无缓冲,fopen有缓冲。

linux中什么叫端口映射linux中什么叫端口映射May 09, 2022 pm 01:49 PM

端口映射又称端口转发,是指将外部主机的IP地址的端口映射到Intranet中的一台计算机,当用户访问外网IP的这个端口时,服务器自动将请求映射到对应局域网内部的机器上;可以通过使用动态或固定的公共网络IP路由ADSL宽带路由器来实现。

什么是linux交叉编译什么是linux交叉编译Apr 29, 2022 pm 06:47 PM

在linux中,交叉编译是指在一个平台上生成另一个平台上的可执行代码,即编译源代码的平台和执行源代码编译后程序的平台是两个不同的平台。使用交叉编译的原因:1、目标系统没有能力在其上进行本地编译;2、有能力进行源代码编译的平台与目标平台不同。

linux中eof是什么linux中eof是什么May 07, 2022 pm 04:26 PM

在linux中,eof是自定义终止符,是“END Of File”的缩写;因为是自定义的终止符,所以eof就不是固定的,可以随意的设置别名,linux中按“ctrl+d”就代表eof,eof一般会配合cat命令用于多行文本输出,指文件末尾。

linux怎么判断pcre是否安装linux怎么判断pcre是否安装May 09, 2022 pm 04:14 PM

在linux中,可以利用“rpm -qa pcre”命令判断pcre是否安装;rpm命令专门用于管理各项套件,使用该命令后,若结果中出现pcre的版本信息,则表示pcre已经安装,若没有出现版本信息,则表示没有安装pcre。

linux怎么查询mac地址linux怎么查询mac地址Apr 24, 2022 pm 08:01 PM

linux查询mac地址的方法:1、打开系统,在桌面中点击鼠标右键,选择“打开终端”;2、在终端中,执行“ifconfig”命令,查看输出结果,在输出信息第四行中紧跟“ether”单词后的字符串就是mac地址。

linux中rpc是什么意思linux中rpc是什么意思May 07, 2022 pm 04:48 PM

在linux中,rpc是远程过程调用的意思,是Reomote Procedure Call的缩写,特指一种隐藏了过程调用时实际通信细节的IPC方法;linux中通过RPC可以充分利用非共享内存的多处理器环境,提高系统资源的利用率。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前By尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

MantisBT

MantisBT

Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

SublimeText3 英文版

SublimeText3 英文版

推薦:為Win版本,支援程式碼提示!

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

將Eclipse與SAP NetWeaver應用伺服器整合。

Dreamweaver Mac版

Dreamweaver Mac版

視覺化網頁開發工具