Table of Contents
安装前期准备
开始安装
启动MySQL" >启动MySQL
Home Database Mysql Tutorial Linux下MySQL安装详解_MySQL

Linux下MySQL安装详解_MySQL

May 27, 2016 pm 01:45 PM

安装前期准备

1.需要mysql安装包,并解压,解压命令 tar -zxvf +压缩包名
这里写图片描述
2.将其复制到需要安装的位置
这里写图片描述
我打算安装到/usr/local/mysql目录下
3.创建mysql用户与mysql组,用于管理mysql
这里写图片描述

开始安装

1.配置安装等信息

./configure --prefix=/usr/local/mysql/   
--with-charset=utf8 --with-extra-charsets=all 
--with-unix-socket-path=/usr/local/mysql/var/mysql.sock 
--with-named-curses-libs=/lib/libncursesw.so.5
Copy after login

查看安装配置参数方式./configure &ndash;help<br><img src="/static/imghw/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c160504/14623310U1GZ-11c06.jpg" class="lazy" alt="这里写图片描述" title="\"><br>配置常用参数说明:

参数 说明
&ndash;prefix=/usr/local/mysql/ 安装路径
&ndash;with-charset=utf8 mysql默认字符集
with-extra-charsets=all 支持多语言
&ndash;with-unix-socket-path=/usr/local/mysql/var/mysql.sock 这个是指定mysql服务器启动后,联机套接字文件所处的位置和文件名,也就是说,如果CentOS mysql服务器成功启动后,就能在//usr/local/mysql/mysql/var目录中看到mysql.sock文件。如果看不到,肯定是CentOS mysql启动不了
&ndash;with-named-curses-libs=/lib/libncursesw.so.5 为了让mysql能够识别出路径

mysql允许的字符集有<br><img src="/static/imghw/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c160504/14623310U50-124E9.jpg" class="lazy" alt="这里写图片描述" title="\"><br>配置完成界面如下<br><img src="/static/imghw/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c160504/14623310U6250-13c29.jpg" class="lazy" alt="这里写图片描述" title="\"><br>2.执行make命令<br>如果此时提示如下错误<br>No curses/termcap library found<br><img src="/static/imghw/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c160504/14623310UY060-141331.jpg" class="lazy" alt="这里写图片描述" title="\"><br>解决办法:<br>解决方式(CentOS)<br>yum list"grep ncurses<br>yum -y install ncurses-devel<br>最后界面如下<br><img src="/static/imghw/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c160504/14623310V1250-15SJ.jpg" class="lazy" alt="这里写图片描述" title="\"><br>3.执行make install 命令

4.创造mysql授权表<br>做了这些工作以后,还得创造CentOS mysql授权表,否则数据库也是启动不了。mysql安装的命令都安装到了/usr/local/mysql/bin这个目录中。<br>运行mysql_install_db命令过后,我们查看/usr/local/mysql就会发现,有个var的目录。这个目录,就是用来装所有数据库的位置,比如我们创建了xxpt的数据库后,就在在/usr/local/mysql/var目录中有xxpt的目录。<br><img src="/static/imghw/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c160504/14623310V3Z60-164517.jpg" class="lazy" alt="这里写图片描述" title="\">

启动MySQL

启动mysql<br>mysql.server start<br><img src="/static/imghw/default1.png" data-src="http://img.bitscn.com/upimg/allimg/c160504/14623310V5N10-1M336.jpg" class="lazy" alt="这里写图片描述" title=""><br>关闭mysql<br>mysql.server stop<br>mysql.server文件位于/usr/local/mysql/share/mysql目录中。

以上就是Linux下MySQL安装详解_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!


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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

Solve database connection problem: a practical case of using minii/db library Solve database connection problem: a practical case of using minii/db library Apr 18, 2025 am 07:09 AM

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

How to set shortcut keys for sublime How to set shortcut keys for sublime Apr 16, 2025 am 09:15 AM

To set the shortcut keys for Sublime Text, follow these steps: Open the shortcut key settings file Key Bindings - User. Add shortcut key settings using the format { "keys": ["key combination"], "command": "command" }. Save changes. Reload the shortcut key settings for the changes to take effect.

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

How to set important Git configuration global properties How to set important Git configuration global properties Apr 17, 2025 pm 12:21 PM

There are many ways to customize a development environment, but the global Git configuration file is one that is most likely to be used for custom settings such as usernames, emails, preferred text editors, and remote branches. Here are the key things you need to know about global Git configuration files.

See all articles