Heim >Datenbank >MySQL-Tutorial >Ubuntu13.10编译安装MySQL5.6_MySQL
Ubuntu
1.下载MySQL5.6源码包
2.解压 tar -zxvf mysql*****.tar.gz 压缩包与tar后的文件不要放在一个目录中
cp -vRp mysql*** /usr/local/mysql
4.添加mysql组 groupadd mysql
5.添加mysql用户 useradd -r -g mysql mysql
sudo apt-get install build-essential gcc g++ libncurses5-dev
sudo apt-get install Bison
-DENABLE_DOWNLOADS=1
9.make
10.make install
11.设置MySQL安装目录权限 chown -R mysql:mysql /usr/local/mysql
12.查看scripts/mysql_install_db的权限 ls -l scripts/mysql_install_db
如果没有x权限,则 chmod +x /usr/local/mysql/scripts/mysql_install_db
13.初始化MySQL scripts/mysql_install_db --user=mysql
14.复制权限文件 cp support-files/mysql.server /etc/init.d/mysqld
15.重命名权限文件 mv /etc/init.d/mysqld/mysql.server /etc/init.d/mysqld/mysqld.server
16.修改MySQL安装目录权限 chown -R root /usr/local/mysql
17.修改mysql/data目录权限 chown -R mysql /usr/local/mysql/data
18.启动MySQL bin/mysqld_safe --user=mysql &
19.进入mysql bin/mysql -u root
20.给root用户添加密码 bin/mysqladmin -u root password 'root'
21.复制my.cnf配置文件 cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf