标签:
rpm -qa | grep mysql
rpm -e mysql #普通删除模式
rpm -e --nodeps xxx(xxx为刚才的显示的列表) # 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除
rm /etc/my.cnf #删除/etc/my.cnf
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
groupadd mysql
useradd -s /sbin/nologin -g mysql mysql
cd /usr/local/src
wget -c http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.33.tar.gz
tar zxvf mysql-5.6.33.tar.gz
cd mysql-5.6.33/
cmake
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/data/mysql/data
-DSYSCONFDIR=/etc
-DWITH_MYISAM_STORAGE_ENGINE=1
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_MEMORY_STORAGE_ENGINE=1
-DWITH_READLINE=1
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock
-DMYSQL_TCP_PORT=3306
-DENABLED_LOCAL_INFILE=1
-DWITH_PARTITION_STORAGE_ENGINE=1
-DEXTRA_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
make && make install
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/data --user=mysql
cp support-files/mysql.server /etc/init.d/mysql
chkconfig mysql on
service mysql start
export PATH=/usr/local/mysql/bin:$PATH
source /etc/profile
mysql -uroot
mysql> SET PASSWORD = PASSWORD(‘123456‘);
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘password‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p -dport 3306 -j ACCEPT
service iptables restart
标签:
原文地址:http://www.cnblogs.com/wangxin-king/p/5935628.html