Home  >  Article  >  Database  >  Ubuntu源码安装MySQL官方标准步骤

Ubuntu源码安装MySQL官方标准步骤

WBOY
WBOYOriginal
2016-06-07 16:55:401076browse

ubuntu源码安装Mysql官方标准步骤一、安装Mysql1、sudo apt-get install g++ gcc make automake perl libncurses5-dev kdelibs_d

Ubuntu源码安装MySQL官方标准步骤

一、安装Mysql
1、sudo apt-get install g++ gcc make automake perl libncurses5-dev kdelibs_dev kdelib
(确保需要的工具完好安装)
2、cd ~/Downloads
(进入压缩包所在目录)
3、tar zxvf mysql-6.0.2-alpha.tar.gz
(解压到此处)
4、cd mysql-6.0.2-alpha
(进入解压出来的源码包文件夹)
5、 ./configure --prefix=/usr/local/mysql
(指定安装路径)
6、make
(编译安装程序)
7、sudo make install
(进行安装)
8、sudo cp support-files/my-medium.cnf /etc/my.cnf
(复制源码包内的设置文件到/etc/系统统一的设置文件路径)
9、sudo ln -s /usr/local/mysql/bin/mysql /usr/bin/
sudo ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/
sudo ln -s /usr/local/mysql/bin/mysqld_safe /usr/bin/
sudo ln -s /usr/local/mysql/bin/mysql_conf /usr/bin/
sudo ln -s /usr/local/mysql/share/mysql/mysql.server /usr/bin/
(添加执行程序的软链接,这只是为了方便,喜欢用完整路径的可以不做)
10、sudo groupadd mysql
(创建用户组mysql)
11、sudo useradd -g mysql mysql
(在用户组mysql下创建用户mysql)
12、cd /usr/local/mysql
(进入主程序目录)
13、sudo bin/mysql_install_db --user=mysql
(如果还没有安装的MySQL,,必须创建MySQL授权表。创建后,需要手动重新启动服务器)
14、sudo chown -R root .
(使/usr/local/mysql/目录下所有文件为根用户root所有)
15、sudo chown -R mysql var
(使/usr/local/mysql/var/目录下所有文件为用户mysql所有)
16、sudo chgrp -R mysql .
(使/usr/local/mysql/目录下所有文件为用户组mysql所有)
17、sudo bin/mysql_safe --use=mysql &
(初始化并测试你的mysql,其中&为后台执行的意思)

linux

Statement:
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