Home Database Mysql Tutorial linux 下 MySQL源码包的安装_MySQL

linux 下 MySQL源码包的安装_MySQL

Jun 01, 2016 pm 02:02 PM
linux mysql Install

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

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to open phpmyadmin How to open phpmyadmin Apr 10, 2025 pm 10:51 PM

You can open phpMyAdmin through the following steps: 1. Log in to the website control panel; 2. Find and click the phpMyAdmin icon; 3. Enter MySQL credentials; 4. Click "Login".

How to start the server with redis How to start the server with redis Apr 10, 2025 pm 08:12 PM

The steps to start a Redis server include: Install Redis according to the operating system. Start the Redis service via redis-server (Linux/macOS) or redis-server.exe (Windows). Use the redis-cli ping (Linux/macOS) or redis-cli.exe ping (Windows) command to check the service status. Use a Redis client, such as redis-cli, Python, or Node.js, to access the server.

phpmyadmin connection mysql phpmyadmin connection mysql Apr 10, 2025 pm 10:57 PM

How to connect to MySQL using phpMyAdmin? The URL to access phpMyAdmin is usually http://localhost/phpmyadmin or http://[your server IP address]/phpmyadmin. Enter your MySQL username and password. Select the database you want to connect to. Click the "Connection" button to establish a connection.

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

phpMyAdmin comprehensive use guide phpMyAdmin comprehensive use guide Apr 10, 2025 pm 10:42 PM

phpMyAdmin is not just a database management tool, it can give you a deep understanding of MySQL and improve programming skills. Core functions include CRUD and SQL query execution, and it is crucial to understand the principles of SQL statements. Advanced tips include exporting/importing data and permission management, requiring a deep security understanding. Potential issues include SQL injection, and the solution is parameterized queries and backups. Performance optimization involves SQL statement optimization and index usage. Best practices emphasize code specifications, security practices, and regular backups.

How to use single threaded redis How to use single threaded redis Apr 10, 2025 pm 07:12 PM

Redis uses a single threaded architecture to provide high performance, simplicity, and consistency. It utilizes I/O multiplexing, event loops, non-blocking I/O, and shared memory to improve concurrency, but with limitations of concurrency limitations, single point of failure, and unsuitable for write-intensive workloads.

Summary of phpmyadmin vulnerabilities Summary of phpmyadmin vulnerabilities Apr 10, 2025 pm 10:24 PM

The key to PHPMyAdmin security defense strategy is: 1. Use the latest version of PHPMyAdmin and regularly update PHP and MySQL; 2. Strictly control access rights, use .htaccess or web server access control; 3. Enable strong password and two-factor authentication; 4. Back up the database regularly; 5. Carefully check the configuration files to avoid exposing sensitive information; 6. Use Web Application Firewall (WAF); 7. Carry out security audits. These measures can effectively reduce the security risks caused by PHPMyAdmin due to improper configuration, over-old version or environmental security risks, and ensure the security of the database.

The 5 Pillars of Linux: Understanding Their Roles The 5 Pillars of Linux: Understanding Their Roles Apr 11, 2025 am 12:07 AM

The five pillars of the Linux system are: 1. Kernel, 2. System library, 3. Shell, 4. File system, 5. System tools. The kernel manages hardware resources and provides basic services; the system library provides precompiled functions for applications; the shell is the interface for users to interact with the system; the file system organizes and stores data; and system tools are used for system management and maintenance.

See all articles