1、下载MySQL安装包,去MySQL官网即可下载。
2、解压安装包,执行命令:
1
tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz
3、复制解压后的mysql目录到系统的本地软件目录,执行命令:
1
cp mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql -r
4、添加系统mysql组和mysql用户,执行命令:
1
groupadd mysql和useradd -r -g mysql mysql
5、开始编译安装MySQL数据库工具:
1
2
3
4
5
6
7
8
9
10
11
12
##进入安装mysql软件目录:执行命令
cd /usr/local/mysql
##修改<a href="https://www.baidu.com/s?wd=%E5%BD%93%E5%89%8D%E7%9B%AE%E5%BD%95&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9nyP9njbYujbYPWm4mW6v0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnWc3njR4PW0d" target="_blank" class="baidu-highlight">当前目录</a>拥有者为mysql用户:执行命令
chown -R mysql:mysql ./
##安装数据库:执行命令
./scripts/mysql_install_db --user=mysql
##修改<a href="https://www.baidu.com/s?wd=%E5%BD%93%E5%89%8D%E7%9B%AE%E5%BD%95&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1d9nyP9njbYujbYPWm4mW6v0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnWc3njR4PW0d" target="_blank" class="baidu-highlight">当前目录</a>拥有者为root用户:执行命令
chown -R root:root ./
##修改当前data目录拥有者为mysql用户:执行命令
chown -R mysql:mysql data
##到此数据库安装完毕,启动mysql服务:执行命令
service mysql start
1、安装linux一些必须的包:yum install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* libevent
2、安装mysql,mysql安装包需要自己下载,安装目录 /usr/local/web/
sudo mkdir -p /usr/local/web/
sudo tar xzvf mysql-5.1.39.tar.gz
cd mysql-5.1.39
./configure --prefix=/usr/local/web/mysql.5.1.39 --enable-thread-safe-client --enable-assembler --with-big-tables --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=complex
make
make install
3、创建mysql用户组等信息
sudo groupadd mysql
sudo useradd -g mysql -s /sbin/nologin mysql
sudo ./scripts/mysql_install_db --user=mysql --datadir=/usr/local/web/mysql.5.1.39/var
sudo chown -R root /usr/local/web/mysql.5.1.39
sudo chown -R mysql:mysql /usr/local/web/mysql.5.1.39/var
4、管理MYSQL
#启动mysql:
sudo /usr/local/web/mysql.5.1.39/share/mysql/mysql.server start
#重启mysql
sudo /usr/local/web/mysql.5.1.39/share/mysql/mysql.server restart
#停止mysql
sudo /usr/local/web/mysql.5.1.39/share/mysql/mysql.server stop
linux
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)