标签:logs .so nodeps with exp family echo eve blog
一:卸载旧版本
使用下面的命令检查是否安装有MySQL Server
rpm -qa | grep mysql
有的话通过下面的命令来卸载掉
rpm -e mysql //普通删除模式 rpm -e --nodeps mysql // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除
二:安装MySQL
安装编译代码需要的包
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
#wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz #tar xvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz #mv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql
创建mysql用户和组
#groupadd mysql #useradd -r -g mysql mysql -d /usr/local/mysql #echo "mima" | passwd --stdin mysql
修改目录权限
chown -R mysql:mysql /usr/local/mysql
安装数据库
#su - mysql #/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data #exit
复制mysql配置文件
#cd /usr/local/mysql/support-files #cp my-default.cnf /etc/my.cnf
添加系统服务
#cp mysql.server /etc/init.d/mysql #chkconfig mysql on
.添加环境变量
#vim /etc/profile export MYSQL_HOME="/usr/local/mysql" export PATH="$PATH:$MYSQL_HOME/bin" #source /etc/profile
启动mysql
service mysql start
设置root密码
mysqladmin -u root password ‘123456‘
设置默认端口
#vim /etc/my.cnf [mysqld] basedir=/usr/local/mysql datadir=/usr/local/mysql/data port=3306 server_id=1 socket=/tmp/mysql.sock
允许所有外部链接访问(可选)
#mysql -u root -p #mysql命令行输入 GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION; FLUSH PRIVILEGES;
参考文档:
http://www.cnblogs.com/liuyi2614/p/6382183.html
标签:logs .so nodeps with exp family echo eve blog
原文地址:http://www.cnblogs.com/saneri/p/6617415.html