标签:mysql
1.1 创建支持mysql运行的虚拟用户【可以放后面】useradd -s /sbin/nologin -M mysql
cd /server/tools/
wget http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.6/mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz
tar xf mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.6.40-linux-glibc2.12-x86_64 /application/mysql-5.6.40
ln -s /application/mysql-5.6.40/ /application/mysql
chown -R mysql.mysql /application/mysql/data/
/application/mysql/scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
cp /application/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init.d/mysqld
cp /application/mysql/support-files/my-default.cnf /etc/my.cnf
/etc/init.d/mysqld start
echo 'export PATH=/application/mysql/bin/:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' >>/etc/profile
#设置密码/application/mysql/bin/mysqladmin -u root password '123456'
#登陆 mysql -u root -p123456
update mysql.user set password=password('oldboy123') where User="wordpress" and Host="172.16.1.0/255.255.255.0";
grant all on www.* to www@'172.16.1.%' identified by '123456'; 【方法一】
grant all on bbs.* to bbs@'172.16.1.0/255.255.255.0' identified by '123456';【方法二】
grant all on wordpress.* to wordpress@'localhost' identified by '123456'; 【授权本地登陆】
drop user wordpress@'172.16.1.0/255.255.255.0';
create database zabbix;
drop database zabbix;
show databases;
flush privileges;
标签:mysql
原文地址:http://blog.51cto.com/13667111/2125265