码迷,mamicode.com
首页 > 数据库 > 详细

install mySQL on RHEL 32bit

时间:2015-03-05 07:03:00      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:mysql

3 ways to install mysql


  1. # yum install mysql mysql-server

  2. # rpm -ivh MySQL-client-5.6.23-1.linux_glibc2.5.i386.rpm MySQL-server-5.6.23-1.linux_glibc2.5.i386.rpm

  3. install by binary file (may need to install cmake gcc gcc-c++ ncurses first):

    a. # tar xvf mysql-5.6.23.tar.gz -C /usr/src

    b. # cd /usr/src/mysql-5.6.23

    c. # cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=ON

    d. # make j2

    e. # make install

note: options of cmake please refer to official docs


after installation, set up the configuration files (if use default configuration, jump to start mysql and set up password).

# vim /etc/my.cnf

[mysqld]
datadir=/data
user=mysql
socket=/data/mysqld.sock
skip-name-resolve
port=3306
log-bin=/data/mysqld-bin
log-bin-index=/data/mysql-bin
server-id=1

[mysqld_safe]
log-error=/data/mysqld.err
pid-file=/data/mysqld.pid


make directory and initiate

# rm -rf /data
# mkdir /data

# cd /usr/local/mysql
# ./scripts/mysql_install_db --datadir=/data --user=mysql


start mysql and set up password

# mysqld_safe --defaults-file=/etc/my.cnf &
or
# cp ./support-files/mysql.server  /etc/rc.d/init.d/sql
# chmod 755 /etc/rc.d/init.d/sql
# service sql start


# mysqladmin -u root -S /data/mysqld.sock password ‘123‘
# mysqladmin -u root -h 127.0.0.1 -P 3306 password ‘123‘
or
# ln -s /data/mysqld.sock /tmp/mysql.sock
# mysql_secure_installation
# rm -rf  /tmp/mysql.sock


login mysql

# mysql -u root -S /data/mysqld.sock 

or

# mysql -u root  -h 127.0.0.1 -P3306


install mySQL on RHEL 32bit

标签:mysql

原文地址:http://nicwon.blog.51cto.com/9926038/1617338

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!