ubuntu14安装mysql5.6_ubuntu14.04安装mysql5.6

apt-get install -y mysql-server-5.6

service mysql stop

cp -a /etc/mysql/my.cnf /etc/mysql/my.cnf.bak

sed -i 's|3306|3307|g' /etc/mysql/my.cnf

sed -i 's|/var/log/mysql|/data/mysql/log|g' /etc/mysql/my.cnf

sed -i 's|/var/lib/mysql|/data/mysql/data|g' /etc/mysql/my.cnf

sed -i 's|bind-address|#bind-address|g' /etc/mysql/my.cnf

sed -i 's|/var/log/mysql|/data/mysql/log|g' /etc/apparmor.d/usr.sbin.mysqld

sed -i 's|/var/lib/mysql|/data/mysql/data|g' /etc/apparmor.d/usr.sbin.mysqld

[mysqld]

slow-query-log-file = /data/mysql/log/mysql-slow.log

long_query_time = 2

log-queries-not-using-indexes

mkdir -p /data/mysql/log

mkdir -p /data/mysql/data

cp -av /var/lib/mysql/* /data/mysql/data

chown -R mysql:mysql /data/mysql

service apparmor restart

service mysql restart

ps -ef|grep mysql

mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456';FLUSH PRIVILEGES;"

mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '123456';FLUSH PRIVILEGES;"

mysql -uroot -p123456 -e "delete from mysql.user where host != '%' and host != 'localhost';"

apt-get autoclean

apt-get clean

apt-get autoremove

彻底卸载mysql

rm -rf /var/lib/mysql/

rm -rf /etc/mysql/

apt-get autoremove --purge mysql-server-5.6

apt-get remove mysql-server

apt-get autoremove mysql-server

apt-get remove mysql-common

dpkg -l |grep ^rc|awk '{print $2}'|xargs dpkg -P

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值