如何在虚拟机VMware下的linux系统里安装mysql

2022-07-31 科技 97阅读
  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
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com