创建MySQL用户
useradd –s /sbin/nologin –g mysql –M mysql解压缩二进制安装MySQL
tar xf mysql-5.5.32-linux2.6-x86_64.tar.gzmv mysql-5.5.32-linux2.6-x86_64 mysqlchown mysql.mysql -R mysql/cd mysql cd scripts/./mysql_install_db --basedir=/application/mysql/ --datadir=/applicationl/data/ --user=mysqlcp ../support-files/my-small.cnf /etc/my.cnfcp ../support-files/mysql.server /etc/init.d/mysqld由于二进制安装目录是/application/mysql,所以需要更改目录
然后设置环境变量并使其生效
vi /etc/init.d/mysqld vi /application/mysql/bin/mysqld_safe:%s#/usr/local/mysql#/application/mysql#gecho ‘export PATH=/application/mysql/bin:$PATH’ >>/etc/PRofilesourse /etc/profileMySQL安全配置,给root用户设置密码
mysqladmin –u root passWord ‘000000’
新闻热点
疑难解答