rhces 发表于 2018-5-11 13:34:35

redhat下mysql.tar.gz的安装

  1.将包解压到当前目录并建立一个名叫 mysql 的链接
tar zxvf mysql-5.7.1-m11-linux-glibc2.5-i686.tar.gz

  ln -s mysql-5.7.1-m11-linux-glibc2.5-i686 /usr/local/mysql

2.初始化mysql数据库(定义授权表和数据目录)
  scripts/mysql_install_db --user=root --datadir=/DATADIR

3.将mysql服务控制程序拷贝到init.d目录下
cp support-files/mysql.server /etc/init.d/mysqld

4.让mysqld在系统启动时自动运行
chkconfig --add mysqld
chkconfig mysqld on

5.拷贝一个配置文件模板到etc目录 在部分指定数据文件目录
cp support-files/my-large.cnf /etc/my.cnf
修改/etc/my.cnf
  找到,添加:
  user=root
  datadir=/DATADIR
  
6.启动MySQL服务器
/etc/init.d/mysqld

7.将mysql/bin目录加到系统环境变量
  vi /etc/profile
  PATH=/usr/local/mysql/bin:$PATH
  export PATH
  wq
. /etc/profile
  

  8.创建新用户和新数据库
  #mysql
  mysql>create database openfire;//创建新的数据库openfire
  mysql>grant all privileges on *.* to 'openfire'@'%' identified by '';
  //创建新用户openfire,密码为空串
  mysql>flush privileges;//刷新授权
  
页: [1]
查看完整版本: redhat下mysql.tar.gz的安装