Ubuntu13.10编译安装MySQL5.6_MySQL
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
如果需要重新cmake,则需要删除之前生产的CMakeCache.txt
cmake
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /
-DMYSQL_DATADIR=/usr/local/mysql/data /
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock /
-DDEFAULT_CHARSET=utf8 /
-DDEFAULT_COLLATION=utf8_general_ci /
-DEXTRA_CHARSETS=all
-DWITH_MYISAM_STORAGE_ENGINE=1 /
-DWITH_INNOBASE_STORAGE_ENGINE=1 /
-DENABLED_LOCAL_INFILE=1 /
-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
上一篇: [Mysql]mysqlwindows下配置文件_MySQL
下一篇: 2.PHP入门